use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class DriverTestPageWithoutFixedPattern method move.
public void move() {
CustomEventFiringWebDriver driver = (CustomEventFiringWebDriver) (getDriver());
HtmlElement html = new HtmlElement("", By.tagName("html"));
driver.manage().window().getPosition();
driver.manage().window().getSize();
driver.getViewPortDimensionWithoutScrollbar();
new Actions(driver).moveToElement(html).moveByOffset(10, 100).click().perform();
driver.getCurrentUrl();
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestPageObject method testResizeWindowHeadless.
@Test(groups = { "it" })
public void testResizeWindowHeadless() throws Exception {
SeleniumTestsContextManager.getThreadContext().setBrowser("*htmlunit");
driver = WebUIDriver.getWebDriver(true);
new DriverTestPage(true);
new DriverTestPage(true).resizeTo(600, 400);
Dimension viewPortSize = ((CustomEventFiringWebDriver) driver).getViewPortDimensionWithoutScrollbar();
Assert.assertEquals(viewPortSize.width, 600);
Assert.assertEquals(viewPortSize.height, 400);
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestCustomEventFiringWebDriver method testNullJavascriptReplyForContentDimension.
/**
* check that if an error occurs during javascript invocation, window size is returned (issue #161)
*/
@Test(groups = { "ut" })
public void testNullJavascriptReplyForContentDimension() {
Dimension dim = ((CustomEventFiringWebDriver) eventDriver).getContentDimension();
// check we get the window dimension
Assert.assertEquals(dim.height, 100);
Assert.assertEquals(dim.width, 100);
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestCustomEventFiringWebDriver method testNullJavascriptReplyForContentDimensionWithoutScrollbar.
/**
* check that if an error occurs during javascript invocation, window size is returned (issue #161)
*/
@Test(groups = { "ut" })
public void testNullJavascriptReplyForContentDimensionWithoutScrollbar() {
Dimension dim = ((CustomEventFiringWebDriver) eventDriver).getViewPortDimensionWithoutScrollbar();
// check we get the window dimension
Assert.assertEquals(dim.height, 100);
Assert.assertEquals(dim.width, 100);
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestCustomEventFiringWebDriver method testViewPortDimensionWithoutScrollbarNotGet.
/**
* issue #238: check that if at least 1 dimension is the max one, switch to default content to retrieve it
*/
@Test(groups = { "ut" })
public void testViewPortDimensionWithoutScrollbarNotGet() {
// retry when getting width
when(driver.executeScript(anyString(), eq(true))).thenReturn(100000L).thenReturn(120L).thenReturn(80L);
Dimension dim = ((CustomEventFiringWebDriver) eventDriver).getViewPortDimensionWithoutScrollbar();
verify(driver).switchTo();
// check we get the window dimension
Assert.assertEquals(dim.height, 80);
Assert.assertEquals(dim.width, 120);
}
Aggregations