use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetDefaultFirefoxWindowsProfile.
@Test(groups = { "ut" })
public void testGetDefaultFirefoxWindowsProfile() throws Exception {
PowerMockito.mockStatic(OSUtility.class);
when(OSUtility.getCurrentPlatorm()).thenReturn(Platform.WINDOWS);
BrowserInfo bi = new BrowserInfo(BrowserType.FIREFOX, "58.0", null);
Assert.assertTrue(bi.getDefaultProfilePath().replace("\\", "/").matches("C:/Users/.*?/AppData/Roaming/Mozilla/Firefox/Profiles/.*\\.default"));
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetDriverFilesWithInstalledArtifactForOtherOS.
/**
* Check we filter drivers by OS
* @throws Exception
*/
@Test(groups = { "ut" })
public void testGetDriverFilesWithInstalledArtifactForOtherOS() throws Exception {
PowerMockito.mockStatic(OSUtility.class);
when(OSUtility.getCurrentPlatorm()).thenReturn(Platform.LINUX);
String[] driversFiles = new String[] { "windows/chromedriver_2.20_chrome-55-57_android-6.0.exe", "windows/chromedriver_2.29_chrome-56-58_android-7.0.exe", "windows/chromedriver_2.31_chrome-58-60.exe" };
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.CHROME, "55.0", null));
PowerMockito.when(bInfo, "getDriverListFromJarResources", "driver-list-linux.txt").thenReturn(driversFiles);
Assert.assertEquals(bInfo.getDriverFiles().size(), 0);
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInfoFromVersion.
@Test(groups = { "ut" })
public void testGetInfoFromVersion() {
BrowserInfo bi1 = new BrowserInfo(BrowserType.CHROME, "48.0", null);
BrowserInfo bi2 = new BrowserInfo(BrowserType.CHROME, "58.0", null);
BrowserInfo biFromVersion = BrowserInfo.getInfoFromVersion("58.0", Arrays.asList(bi1, bi2));
Assert.assertEquals(biFromVersion, bi2);
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testGetInfoFromVersionNullInfo.
@Test(groups = { "ut" })
public void testGetInfoFromVersionNullInfo() {
BrowserInfo bi1 = new BrowserInfo(BrowserType.CHROME, "48.0", null);
BrowserInfo bi2 = new BrowserInfo(BrowserType.CHROME, "58.0", null);
BrowserInfo biFromVersion = BrowserInfo.getInfoFromVersion("58.0", Arrays.asList(bi1, null, bi2));
Assert.assertEquals(biFromVersion, bi2);
}
use of com.seleniumtests.browserfactory.BrowserInfo in project seleniumRobot by bhecquet.
the class TestBrowserInfo method testChromeVersionHighestDriverVersion.
/**
* Check we take the highest driver version matching this chrome version
* @throws Exception
*/
@Test(groups = { "ut" })
public void testChromeVersionHighestDriverVersion() throws Exception {
List<String> driverList = Arrays.asList("chromedriver_2.28_chrome-55-57_android_7.0.exe", "chromedriver_2.29_chrome-56-58_android_7.0.exe", "chromedriver_2.31_chrome-58-60.exe");
BrowserInfo bInfo = PowerMockito.spy(new BrowserInfo(BrowserType.CHROME, "58.0", null));
PowerMockito.when(bInfo, "getDriverFiles").thenReturn(driverList);
PowerMockito.doNothing().when(bInfo, "checkResourceExists");
Assert.assertEquals(bInfo.getDriverFileName(), "chromedriver_2.31_chrome-58-60");
}
Aggregations