use of com.wikia.webdriver.common.core.elemnt.Wait in project selenium-tests by Wikia.
the class CommentsTests method mercury_comments_tapOnUsernameRedirectsToUserPage.
@Test(groups = "mercury_comments_tapOnUsernameRedirectsToUserPage")
public void mercury_comments_tapOnUsernameRedirectsToUserPage() {
init();
comments.clickCommentsHeader();
comments.waitForCommentsToLoad();
String username = comments.getUserUsername(0);
comments.clickOnUsername(0);
new Wait(driver).forElementVisible(OASIS_BODY);
boolean result = username.equals(comments.getUsernameFromUrl());
PageObjectLogging.log("Url", "match pattern /wiki/User:", "does not match pattern /wiki/User:", result);
}
use of com.wikia.webdriver.common.core.elemnt.Wait in project selenium-tests by Wikia.
the class CommentsTests method mercury_comments_containsCounterNextButtonAndPreviousButton.
@Test(groups = "mercury_comments_containsCounterNextButtonAndPreviousButton", enabled = false)
@RelatedIssue(issueID = "DAT-4316")
public void mercury_comments_containsCounterNextButtonAndPreviousButton() {
init();
comments.clickCommentsHeader();
comments.waitForCommentsToLoad();
int numberOfComments = comments.getNumberOfCommentsFromHeader();
Assertion.assertTrue((numberOfComments - comments.getNumberOfRepliesOnThatPage()) > 25, "There is less than 25 on that page");
Assertion.assertTrue(comments.isNextCommentPageButtonDisplayed(), "Next page button isn't displayed");
PageObjectLogging.log("Next page button", "is displayed", true);
while (comments.isNextCommentPageButtonDisplayed()) {
numberOfComments -= comments.getNumberOfAllCommentsOnPage();
comments.clickNextCommentPageButton();
new Wait(driver).forXMilliseconds(2500);
}
numberOfComments -= comments.getNumberOfAllCommentsOnPage();
boolean result = numberOfComments == 0;
PageObjectLogging.log("Comments counter", "is correct", "There are " + numberOfComments + " untracked comments", result);
Assertion.assertTrue(comments.isPreviousCommentPageButtonDisplayed(), "Previous page button isn't displayed");
PageObjectLogging.log("Previous page button", "is displayed", true);
comments.clickPreviousCommentPageButton();
new Wait(driver).forXMilliseconds(2500);
result = !comments.isPreviousCommentPageButtonDisplayed();
PageObjectLogging.log("Previous page button", "is not displayed", "is displayed", result);
}
use of com.wikia.webdriver.common.core.elemnt.Wait in project selenium-tests by Wikia.
the class HTMLTitleTests method seo_guard.
@Test(groups = "seo_guard")
@Execute(asUser = User.USER)
public void seo_guard() {
String originalEnv = Configuration.getEnv();
try {
PrintWriter out = new PrintWriter("./logs/seo-guard.txt");
PrintWriter out2 = new PrintWriter("./logs/seo-guard2.txt");
for (String[] testCase : testCases) {
navigate.toUrl(new Page(testCase[0], testCase[1]).getUrl());
new Wait(driver).forElementVisible(By.cssSelector(".side-nav-toggle-2016"));
this.pushMetaTagsToFile(out);
if (!originalEnv.equals("prod")) {
Configuration.setTestValue("env", "prod");
navigate.toUrl(new Page(testCase[0], testCase[1]).getUrl());
new Wait(driver).forElementVisible(By.cssSelector(".side-nav-toggle-2016"));
this.pushMetaTagsToFile(out2);
Configuration.setTestValue("env", originalEnv);
}
}
out.close();
out2.close();
} catch (FileNotFoundException e) {
}
}
Aggregations