use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testNonBetaVersionBrowserChoosen.
/**
* If beta is not requested, get the non beta version even if both are present
*/
@Test(groups = { "ut" })
public void testNonBetaVersionBrowserChoosen() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "101.0", "", false, false), new BrowserInfo(BrowserType.EDGE, "102.0", "", false, true)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(false)).thenReturn(browserInfos);
EdgeCapabilitiesFactory capaFactory = new EdgeCapabilitiesFactory(config);
capaFactory.createCapabilities();
Assert.assertFalse(capaFactory.getSelectedBrowserInfo().getBeta());
Assert.assertEquals(capaFactory.getSelectedBrowserInfo().getVersion(), "101.0");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testBetaVersionBrowserChoosen.
/**
* If beta is requested, get the beta version even if both are present
*/
@Test(groups = { "ut" })
public void testBetaVersionBrowserChoosen() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "102.0", "", false, false), new BrowserInfo(BrowserType.EDGE, "103.0", "", false, true)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(true)).thenReturn(browserInfos);
when(config.getBetaBrowser()).thenReturn(true);
EdgeCapabilitiesFactory capaFactory = new EdgeCapabilitiesFactory(config);
capaFactory.createCapabilities();
Assert.assertTrue(capaFactory.getSelectedBrowserInfo().getBeta());
Assert.assertEquals(capaFactory.getSelectedBrowserInfo().getVersion(), "103.0");
}
Aggregations