use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestHtmlElement method testTap.
@Test(groups = { "ut" })
public void testTap() throws Exception {
SeleniumTestsContextManager.getThreadContext().setTestType(TestType.APPIUM_WEB_ANDROID);
SeleniumTestsContextManager.getThreadContext().setPlatform("android");
when(WebUIDriver.getWebDriver(anyBoolean())).thenReturn(new CustomEventFiringWebDriver(mobileDriver));
doNothing().when(el).findElement(anyBoolean(), anyBoolean());
el.setElement(mobileElement);
el.tap(2, 2);
PowerMockito.verifyPrivate(el, atLeastOnce()).invoke("checkForMobile");
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetChromePid.
@Test(groups = { "it" })
public void testGetChromePid(final ITestContext testNGCtx) {
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().setBrowser("*chrome");
driver = WebUIDriver.getWebDriver(true);
CustomEventFiringWebDriver efDriver = (CustomEventFiringWebDriver) driver;
// there should be one PID for the driver server
List<Long> pids = efDriver.getDriverPids();
Assert.assertEquals(efDriver.getDriverPids().size(), 1);
Assert.assertTrue(OSUtilityFactory.getInstance().getProgramNameFromPid((Long) pids.get(0)).contains("chromedriver"));
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetAllProcess.
@Test(groups = { "it" })
public void testGetAllProcess(final ITestContext testNGCtx) {
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().setBrowser("*chrome");
driver = WebUIDriver.getWebDriver(true);
CustomEventFiringWebDriver efDriver = (CustomEventFiringWebDriver) driver;
List<Long> pids = efDriver.getDriverPids();
List<Long> allPids = efDriver.getBrowserInfo().getAllBrowserSubprocessPids(pids);
// one pid for driver and at least one for browser (chrome starts several processes)
Assert.assertTrue(allPids.size() >= 2);
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInternetExplorerPid.
@Test(groups = { "it" })
public void testGetInternetExplorerPid(final ITestContext testNGCtx) {
if (!SystemUtils.IS_OS_WINDOWS) {
throw new SkipException("This test can only be done on Windows");
}
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().setBrowser("*iexplore");
driver = WebUIDriver.getWebDriver(true);
CustomEventFiringWebDriver efDriver = (CustomEventFiringWebDriver) driver;
// there should be one PID for the driver server
List<Long> pids = efDriver.getDriverPids();
Assert.assertEquals(efDriver.getDriverPids().size(), 1);
Assert.assertTrue(OSUtilityFactory.getInstance().getProgramNameFromPid((Long) pids.get(0)).contains("IEDriverServer"));
}
use of com.seleniumtests.driver.CustomEventFiringWebDriver in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetFirefoxPid.
@Test(groups = { "it" })
public void testGetFirefoxPid(final ITestContext testNGCtx) {
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().setBrowser("*firefox");
driver = WebUIDriver.getWebDriver(true);
CustomEventFiringWebDriver efDriver = (CustomEventFiringWebDriver) driver;
// there should be one PID for the driver server
List<Long> pids = efDriver.getDriverPids();
Assert.assertEquals(efDriver.getDriverPids().size(), 1);
Assert.assertTrue(OSUtilityFactory.getInstance().getProgramNameFromPid((Long) pids.get(0)).contains("geckodriver"));
}
Aggregations