Search in sources :

Example 6 with JavascriptActions

use of com.wikia.webdriver.common.core.elemnt.JavascriptActions in project selenium-tests by Wikia.

the class VideoFanTakeover method scrollToAdVideo.

private void scrollToAdVideo(WebElement element) {
    JavascriptActions javascriptActions = new JavascriptActions(driver);
    javascriptActions.scrollToElement(element, GLOBAL_NAV_HEIGHT);
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions)

Example 7 with JavascriptActions

use of com.wikia.webdriver.common.core.elemnt.JavascriptActions in project selenium-tests by Wikia.

the class TestAdsVuapTheNewGeneration method openPageWithVideoInLocalStorage.

private AdsBaseObject openPageWithVideoInLocalStorage(Page page) {
    final AdsBaseObject ads = new AdsBaseObject(driver);
    ads.getUrl(urlBuilder.getUrlForWiki("project43"));
    JavascriptActions runScript = new JavascriptActions(driver);
    runScript.execute("localStorage.setItem('" + VuapVideos.PORVATA_VAST + VuapVideos.VAST_VIDEO + ");");
    ads.getUrl(page);
    return ads;
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)

Example 8 with JavascriptActions

use of com.wikia.webdriver.common.core.elemnt.JavascriptActions in project selenium-tests by Wikia.

the class TestAdsBrowserError method adsScrollHandlerBrowserError.

@Test(groups = "AdsScrollHandlerBrowserError")
public void adsScrollHandlerBrowserError() {
    JavascriptActions jsActions = new JavascriptActions(driver);
    String testPage = urlBuilder.getUrlForPath("project43", "SyntheticTests/UAP");
    testPage = urlBuilder.appendQueryStringToURL(testPage, "scrollhandler=1");
    AdsBaseObject adsBaseObject = new AdsBaseObject(driver);
    adsBaseObject.getUrl(testPage);
    jsActions.addErrorListenerScript();
    jsActions.waitForJavaScriptTruthy("window.scrollY == 0");
    jsActions.scrollBy(0, 5001);
    jsActions.waitForJavaScriptTruthy("window.scrollY != 0");
    Assertion.assertEquals(jsActions.getWindowErrors(), "");
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Test(org.testng.annotations.Test)

Aggregations

JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)8 Test (org.testng.annotations.Test)3 ArticlePage (com.wikia.webdriver.elements.mercury.pages.ArticlePage)2 AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)2 User (com.wikia.webdriver.common.core.helpers.User)1 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)1 Method (java.lang.reflect.Method)1 Cookie (org.openqa.selenium.Cookie)1 WebDriverException (org.openqa.selenium.WebDriverException)1