use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserDetailsDeviceNameTest.
@Test
public void setupBrowserDetailsDeviceNameTest() {
TestSetup setup = new TestSetup();
setup.setupBrowserDetails(null);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("deviceName"));
Assert.assertNull(capability.getCapability("deviceName"));
setup.setupBrowserDetails(new HashMap<>());
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("deviceName"));
Assert.assertNull(capability.getCapability("deviceName"));
Map<String, String> browserDetails = new HashMap<>();
browserDetails.put("browserName", "CHROME");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("deviceName"));
Assert.assertNull(capability.getCapability("deviceName"));
browserDetails.put("deviceName", "Android");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getCapability("deviceName"), "Android");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityIpadTest.
@Test
public void setupBrowserCapabilityIpadTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.IPAD);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "iPad");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "iPad");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserDetailsDevicePlatformTest.
@Test
public void setupBrowserDetailsDevicePlatformTest() {
TestSetup setup = new TestSetup();
setup.setupBrowserDetails(null);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.PLATFORM));
Assert.assertNull(capability.getCapability(CapabilityType.PLATFORM));
setup.setupBrowserDetails(new HashMap<>());
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.PLATFORM));
Assert.assertNull(capability.getCapability(CapabilityType.PLATFORM));
Map<String, String> browserDetails = new HashMap<>();
browserDetails.put("browserName", "CHROME");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.PLATFORM));
Assert.assertNull(capability.getCapability(CapabilityType.PLATFORM));
browserDetails.put("devicePlatform", "Windows 10");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getPlatform().toString(), "WIN10");
Assert.assertEquals(capability.getCapability(CapabilityType.PLATFORM).toString(), "WIN10");
browserDetails.put("devicePlatform", "Linux");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getPlatform().toString(), "LINUX");
Assert.assertEquals(capability.getCapability(CapabilityType.PLATFORM).toString(), "LINUX");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityAndroidTest.
@Test
public void setupBrowserCapabilityAndroidTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.ANDROID);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "android");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "android");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityOperaTest.
@Test
public void setupBrowserCapabilityOperaTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.OPERA);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "operablink");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "operablink");
}
Aggregations