Search in sources :

Example 1 with Wait

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);
}
Also used : Wait(com.wikia.webdriver.common.core.elemnt.Wait) Test(org.testng.annotations.Test)

Example 2 with Wait

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);
}
Also used : Wait(com.wikia.webdriver.common.core.elemnt.Wait) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 3 with Wait

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) {
    }
}
Also used : FileNotFoundException(java.io.FileNotFoundException) Page(com.wikia.webdriver.common.core.url.Page) Wait(com.wikia.webdriver.common.core.elemnt.Wait) PrintWriter(java.io.PrintWriter) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

Wait (com.wikia.webdriver.common.core.elemnt.Wait)3 Test (org.testng.annotations.Test)3 Execute (com.wikia.webdriver.common.core.annotations.Execute)1 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)1 Page (com.wikia.webdriver.common.core.url.Page)1 FileNotFoundException (java.io.FileNotFoundException)1 PrintWriter (java.io.PrintWriter)1