use of com.seleniumtests.it.driver.support.pages.DriverSubTestPage in project seleniumRobot by bhecquet.
the class TestBrowserSnapshot method testNoScrollbarCapture.
/**
* Test when no scrollbar is present in capture
* @throws Exception
*/
@Test(groups = { "it" })
public void testNoScrollbarCapture() throws Exception {
new DriverSubTestPage(true);
// get real capture
String origFilePath = generateCaptureFilePath();
captureSnapshot(origFilePath);
Dimension screenshotDim = getViewPortDimension(new File(origFilePath));
// get cropped picture
BufferedImage image = new ScreenshotUtil(driver).capture(SnapshotTarget.PAGE, BufferedImage.class);
// check all scrollbars where already removed from screenshot
Assert.assertEquals(image.getWidth(), screenshotDim.width);
Assert.assertEquals(image.getHeight(), screenshotDim.height);
}
use of com.seleniumtests.it.driver.support.pages.DriverSubTestPage in project seleniumRobot by bhecquet.
the class TestPageObject method testCloseLastTab.
/**
* open 3 pages and check that when we close the last one, we go to the previous, not the first one
* @throws Exception
*/
@Test(groups = { "it", "pageobject" })
public void testCloseLastTab() throws Exception {
testPage._goToNewPage();
testPage.getFocus();
DriverSubTestPage subPage2 = testPage._goToNewPage();
subPage2.close();
// check we are on the seconde page (an instance of the DriverSubTestPage)
// next line will produce error if we are not on the page
new DriverSubTestPage();
}
Aggregations