use of com.wikia.webdriver.elements.mercury.pages.CategoryPage in project selenium-tests by Wikia.
the class Category method openCategoryPage.
public CategoryPage openCategoryPage(String name) {
WebElement link = categoryList.findElement(By.cssSelector(String.format("a[title=\"%s\"]", name)));
PageObjectLogging.logInfo(String.format("Open category page named: \"%s\".", name));
wait.forElementClickable(link);
link.click();
loading.handleAsyncPageReload();
Assertion.assertTrue(driver.getCurrentUrl().contains("/wiki/Category:"), "Url is different than /wiki/Category:");
PageObjectLogging.logInfo("You were redirected to /wiki/Category:");
return new CategoryPage();
}
use of com.wikia.webdriver.elements.mercury.pages.CategoryPage in project selenium-tests by Wikia.
the class CategoryPageTest method mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl.
@Test(groups = "mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl")
public void mercury_category_navigateToCategoryPageWithArticleAndWithMembersFromUrl() {
final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
ArticleContent articleContent = new ArticleContent();
articleContent.push("some irrelevant content of category article", categoryName);
articleContent.push(String.format("[[%s]]", categoryName), String.format("A-%s", categoryName));
articleContent.push(String.format("[[%s]]", categoryName), String.format("B-%s", categoryName));
articleContent.push(String.format("[[%s]]", categoryName), String.format("C-%s", categoryName));
CategoryPage category = new CategoryPage().open(categoryName);
Assert.assertFalse("".equals(category.getArticleContent()));
Assert.assertTrue(category.categoryMembersContainerIsVisible());
Assert.assertTrue(category.hasCategoryMembers());
}
use of com.wikia.webdriver.elements.mercury.pages.CategoryPage in project selenium-tests by Wikia.
the class CategoryPageTest method mercury_category_testPagination.
@Test(groups = "mercury_category_testPagination")
public void mercury_category_testPagination() throws InterruptedException {
// This test assumes that there are more than 200 articles created and with category like one below.
// Staging env should have fixture of this articles to create them everytime it is rebuilded
final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
ArticleContent articleContent = new ArticleContent();
articleContent.push("some irrelevant content of category article", categoryName);
// execute this loop only once on staging and then create fixture
// for (int i = 0; i < 300; ++i) {
// articleContent.push(String.format("aa [[%s]]", categoryName), String.format("%d-%s", i, categoryName));
// }
CategoryPage categoryPage = new CategoryPage().open(categoryName);
Assert.assertTrue(categoryPage.hasCategoryMembers());
Assert.assertTrue(categoryPage.nextButtonIsVisible());
categoryPage.clickNextButton();
Assert.assertTrue(categoryPage.hasCategoryMembers());
Assert.assertTrue(categoryPage.previousButtonIsVisible());
// Wait for scroll animation to be finished.
// categoryPage.previousButtonIsVisible() scrolls to element but jQuery animation scrolls back to somewhere in the middle of a page.
Thread.sleep(1000);
categoryPage.clickPreviousButton();
Assert.assertTrue(categoryPage.hasCategoryMembers());
Assert.assertTrue(categoryPage.nextButtonIsVisible());
}
use of com.wikia.webdriver.elements.mercury.pages.CategoryPage in project selenium-tests by Wikia.
the class CategoryPageTest method mercury_category_navigateToCategoryPageFromLinkInArticle.
@Test(groups = "mercury_category_navigateToCategoryPageWithArticleAndWithoutMembersFromLink")
public void mercury_category_navigateToCategoryPageFromLinkInArticle() {
final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
new ArticleContent().push(String.format("[[%s]]", categoryName));
CategoryPage categoryPage = new ArticlePage().open().openCategoryPageFromCategoriesDropdown();
Assert.assertTrue(categoryPage.hasCategoryMembers());
}
use of com.wikia.webdriver.elements.mercury.pages.CategoryPage in project selenium-tests by Wikia.
the class CategoryPageTest method mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl.
@Test(groups = "mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl")
public void mercury_category_navigateToCategoryPageWithoutArticleAndWithMembersFromUrl() {
final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
ArticleContent articleContent = new ArticleContent();
articleContent.push(String.format("[[%s]]", categoryName), String.format("A-%s", categoryName));
articleContent.push(String.format("[[%s]]", categoryName), String.format("B-%s", categoryName));
articleContent.push(String.format("[[%s]]", categoryName), String.format("C-%s", categoryName));
CategoryPage category = new CategoryPage().open(categoryName);
Assert.assertEquals("", category.getArticleContent());
Assert.assertTrue(category.categoryMembersContainerIsVisible());
Assert.assertTrue(category.hasCategoryMembers());
}
Aggregations