Search in sources :

Example 1 with EditCategoryComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject in project selenium-tests by Wikia.

the class ArticlePageObject method editCategory.

public EditCategoryComponentObject editCategory(String category) {
    WebElement editCategory = driver.findElement(By.cssSelector(editCategorySelector.replace("%categoryName%", category)));
    scrollAndClick(editCategory);
    PageObjectLogging.log("editCategory", "edit button on category " + category + " clicked", true);
    return new EditCategoryComponentObject(driver);
}
Also used : EditCategoryComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject) WebElement(org.openqa.selenium.WebElement)

Example 2 with EditCategoryComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject in project selenium-tests by Wikia.

the class VisualEditModePageObject method editCategory.

public EditCategoryComponentObject editCategory(String categoryName) {
    WebElement editCategory = driver.findElement(By.cssSelector(categoryEditSelector.replace("%categoryName%", categoryName)));
    WebElement category = driver.findElement(By.cssSelector(".category[data-name='" + categoryName + "']"));
    new Actions(driver).moveToElement(category).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).perform();
    scrollAndClick(editCategory);
    PageObjectLogging.log("editCategory", "edit category button clicked on category " + categoryName, true);
    return new EditCategoryComponentObject(driver);
}
Also used : Actions(org.openqa.selenium.interactions.Actions) EditCategoryComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject) WebElement(org.openqa.selenium.WebElement)

Example 3 with EditCategoryComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject in project selenium-tests by Wikia.

the class CategoriesArticleTests method CategoriesTestsArticle_005_anonEdit.

@Test(groups = { "CategoriesTestsArticle_005", "CategoriesTestsArticle" })
public void CategoriesTestsArticle_005_anonEdit() {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    ArticlePageObject article = new ArticlePageObject().open();
    String categoryName = PageContent.CATEGORY_NAME_PREFIX + DateTime.now().getMillis();
    article.addCategory(categoryName);
    EditCategoryComponentObject editCategory = article.editCategory(categoryName);
    categoryName = PageContent.CATEGORY_NAME_PREFIX + DateTime.now().getMillis();
    editCategory.editCategoryName(categoryName);
    article.submitCategory();
    article.verifyCategoryPresent(categoryName);
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) EditCategoryComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject) Test(org.testng.annotations.Test)

Example 4 with EditCategoryComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject in project selenium-tests by Wikia.

the class CategoriesTestsEditMode method CategoriesTestsArticleEdit_001_anonEdit.

@Test(groups = { "CategoriesTestsArticleEdit_001", "CategoriesTestsArticleEditMode" })
public void CategoriesTestsArticleEdit_001_anonEdit() {
    WikiBasePageObject base = new WikiBasePageObject();
    String articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditModePageObject visual = base.navigateToArticleEditPage(wikiURL, articleName);
    String categoryName = PageContent.CATEGORY_NAME_PREFIX + visual.getTimeStamp();
    visual.typeCategoryName(categoryName);
    visual.submitCategory();
    visual.verifyCategoryPresent(categoryName);
    EditCategoryComponentObject editCategory = visual.editCategory(categoryName);
    categoryName = PageContent.CATEGORY_NAME_PREFIX + visual.getTimeStamp();
    editCategory.editCategoryName(categoryName);
    visual.verifyCategoryPresent(categoryName);
}
Also used : EditCategoryComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) Test(org.testng.annotations.Test)

Aggregations

EditCategoryComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.editcategory.EditCategoryComponentObject)4 WebElement (org.openqa.selenium.WebElement)2 Test (org.testng.annotations.Test)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)1 Actions (org.openqa.selenium.interactions.Actions)1