use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserDetailsDeviceOrientationTest.
@Test
public void setupBrowserDetailsDeviceOrientationTest() {
TestSetup setup = new TestSetup();
setup.setupBrowserDetails(null);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("device-orientation"));
Assert.assertNull(capability.getCapability("device-orientation"));
setup.setupBrowserDetails(new HashMap<>());
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("device-orientation"));
Assert.assertNull(capability.getCapability("device-orientation"));
Map<String, String> browserDetails = new HashMap<>();
browserDetails.put("browserName", "CHROME");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is("device-orientation"));
Assert.assertNull(capability.getCapability("device-orientation"));
browserDetails.put("deviceOrientation", "Landscape");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getCapability("device-orientation"), "Landscape");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityIllegalBrowserTest.
@Test(expectedExceptions = InvalidBrowserException.class)
public void setupBrowserCapabilityIllegalBrowserTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.NONE);
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserDetailsBrowserVersionTest.
@Test
public void setupBrowserDetailsBrowserVersionTest() {
TestSetup setup = new TestSetup();
setup.setupBrowserDetails(null);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.VERSION));
Assert.assertNull(capability.getCapability(CapabilityType.VERSION));
setup.setupBrowserDetails(new HashMap<>());
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.VERSION));
Assert.assertNull(capability.getCapability(CapabilityType.VERSION));
Map<String, String> browserDetails = new HashMap<>();
browserDetails.put("browserName", "CHROME");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.VERSION));
Assert.assertNull(capability.getCapability(CapabilityType.VERSION));
browserDetails.put("browserVersion", "50");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getVersion(), "50");
Assert.assertEquals(capability.getCapability(CapabilityType.VERSION), "50");
browserDetails.put("browserVersion", "49.1.1");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getVersion(), "49.1.1");
Assert.assertEquals(capability.getCapability(CapabilityType.VERSION), "49.1.1");
browserDetails.put("browserVersion", "latest");
setup.setupBrowserDetails(browserDetails);
capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getVersion(), "latest");
Assert.assertEquals(capability.getCapability(CapabilityType.VERSION), "latest");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityPhantomJSTest.
@Test
public void setupBrowserCapabilityPhantomJSTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.PHANTOMJS);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "phantomjs");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "phantomjs");
}
use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilitySafariTest.
@Test
public void setupBrowserCapabilitySafariTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.SAFARI);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "safari");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "safari");
}
Aggregations