use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInfoFromPath.
@Test(groups = { "ut" })
public void testGetInfoFromPath() {
BrowserInfo bi1 = new BrowserInfo(BrowserType.CHROME, "48.0", "/home/tu/chrome", false);
BrowserInfo bi2 = new BrowserInfo(BrowserType.CHROME, "58.0", "/home/tu/chrome2", false);
BrowserInfo biFromVersion = BrowserInfo.getInfoFromBinary("/home/tu/chrome2", Arrays.asList(bi1, bi2));
Assert.assertEquals(biFromVersion, bi2);
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testChromeVersionMiddleRange.
/**
* Check we can discover version inside a range of versions
* @throws Exception
*/
@Test(groups = { "ut" })
public void testChromeVersionMiddleRange() throws Exception {
List<String> driverList = Arrays.asList("chromedriver_2.28_chrome-55-57_android_7.0", "chromedriver_2.29_chrome-56-58_android_7.0", "chromedriver_2.31_chrome-58-60");
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.CHROME, "57.1", null));
PowerMockito.when(bInfo, "getDriverFiles").thenReturn(driverList);
PowerMockito.doNothing().when(bInfo, "checkResourceExists");
Assert.assertEquals(bInfo.getDriverFileName(), "chromedriver_2.29_chrome-56-58_android_7.0");
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetDefaultChromeMacProfile.
@Test(groups = { "ut" })
public void testGetDefaultChromeMacProfile() throws Exception {
PowerMockito.mockStatic(OSUtility.class);
when(OSUtility.getCurrentPlatorm()).thenReturn(Platform.MAC);
BrowserInfo bi = new BrowserInfo(BrowserType.CHROME, "58.0", null);
Assert.assertTrue(bi.getDefaultProfilePath().matches("/Users/.*?/Library/Application Support/Google/Chrome"));
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInfoFromPathNullInfo.
@Test(groups = { "ut" })
public void testGetInfoFromPathNullInfo() {
BrowserInfo bi1 = new BrowserInfo(BrowserType.CHROME, "48.0", "/home/tu/chrome", false);
BrowserInfo bi2 = new BrowserInfo(BrowserType.CHROME, "58.0", "/home/tu/chrome2", false);
BrowserInfo biFromVersion = BrowserInfo.getInfoFromBinary("/home/tu/chrome2", Arrays.asList(bi1, null, bi2));
Assert.assertEquals(biFromVersion, bi2);
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testChromeVersionNotFound.
/**
* Check that an error is raised when no driver matches a lower browser version
* @throws Exception
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testChromeVersionNotFound() throws Exception {
List<String> driverList = Arrays.asList("chromedriver_2.28_chrome-55-57_android_7.0", "chromedriver_2.29_chrome-56-58_android_7.0", "chromedriver_2.31_chrome-58-60");
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.CHROME, "1.0", null));
PowerMockito.when(bInfo, "getDriverFiles").thenReturn(driverList);
PowerMockito.doNothing().when(bInfo, "checkResourceExists");
bInfo.getDriverFileName();
}
Aggregations