Search in sources :

Example 1 with Page

use of com.wikia.webdriver.common.core.url.Page 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

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