use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testAndroidVersionNoDriver.
/**
* Error raised if no driver file exists
* @throws Exception
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testAndroidVersionNoDriver() throws Exception {
List<String> driverList = Arrays.asList("chromedriver_2.31_chrome-58-60");
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.BROWSER, "5.0", null));
PowerMockito.when(bInfo, "getDriverFiles").thenReturn(driverList);
PowerMockito.doNothing().when(bInfo, "checkResourceExists");
bInfo.getDriverFileName();
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testAndroidVersionNoMatch.
/**
* Error raised if no version matches
* @throws Exception
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testAndroidVersionNoMatch() throws Exception {
List<String> driverList = Arrays.asList("chromedriver_2.20_chrome-55-57_android-6.0", "chromedriver_2.29_chrome-56-58_android-7.0", "chromedriver_2.31_chrome-58-60");
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.BROWSER, "5.0", null));
PowerMockito.when(bInfo, "getDriverFiles").thenReturn(driverList);
PowerMockito.doNothing().when(bInfo, "checkResourceExists");
bInfo.getDriverFileName();
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInfoFromNonExistentVersion.
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testGetInfoFromNonExistentVersion() {
BrowserInfo bi1 = new BrowserInfo(BrowserType.CHROME, "48.0", null);
BrowserInfo bi2 = new BrowserInfo(BrowserType.CHROME, "58.0", null);
BrowserInfo.getInfoFromVersion("57.0", Arrays.asList(bi1, bi2));
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestChromeCapabilityFactory method testCreateChromeCapabilitiesOverrideBinPath.
/**
*/
@Test(groups = { "ut" })
public void testCreateChromeCapabilitiesOverrideBinPath() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
when(config.getChromeBinPath()).thenReturn("/opt/chrome/bin/chrome");
// SeleniumTestsContext class adds a browserInfo when binary path is set
Map<BrowserType, List<BrowserInfo>> updatedBrowserInfos = new HashMap<>();
updatedBrowserInfos.put(BrowserType.CHROME, Arrays.asList(new BrowserInfo(BrowserType.CHROME, "102.0", "", false), new BrowserInfo(BrowserType.CHROME, "103.0", "/opt/chrome/bin/chrome", false)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(false)).thenReturn(updatedBrowserInfos);
MutableCapabilities capa = new ChromeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(((Map<?, ?>) (((ChromeOptions) capa).asMap().get(ChromeOptions.CAPABILITY))).get("binary").toString(), "/opt/chrome/bin/chrome");
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testBrowserInfoMarionetteFirefox.
@Test(groups = { "it" })
public void testBrowserInfoMarionetteFirefox() {
BrowserInfo browserInfo = new BrowserInfo(BrowserType.FIREFOX, "48.0", "/some/path", false);
browserInfo.getDriverFileName();
Assert.assertTrue(browserInfo.isDriverFileSearched());
Assert.assertEquals(browserInfo.getDriverFileName(), "geckodriver");
}
Aggregations