use of org.openqa.selenium.remote.DesiredCapabilities in project selenified by Coveros.
the class SelenifiedTest method beforeSuite.
@BeforeSuite(alwaysRun = true)
public void beforeSuite() throws InvalidBrowserException {
// add some extra capabilities
extraCapabilities = new DesiredCapabilities();
extraCapabilities.setCapability("ignoreProtectedModeSettings", true);
extraCapabilities.setCapability("unexpectedAlertBehaviour", "ignore");
// save the passed in information
if (System.getProperty("appURL") != null) {
setAppURL = System.getProperty("appURL");
System.clearProperty("appURL");
}
if (System.getProperty("browser") != null) {
setBrowser = System.getProperty("browser");
System.clearProperty("browser");
}
if (System.getProperty("hub") != null) {
setHub = System.getProperty("hub");
System.clearProperty("hub");
}
if (System.getProperty("proxy") != null) {
setProxy = System.getProperty("proxy");
System.clearProperty("proxy");
}
super.beforeSuite();
}
use of org.openqa.selenium.remote.DesiredCapabilities in project selenified by Coveros.
the class SelenifiedTest method extraCapabilitiesTest.
@Test
public void extraCapabilitiesTest() {
DesiredCapabilities capability = capabilities.get(0);
Assert.assertTrue((boolean) capability.getCapability("ignoreProtectedModeSettings"));
Assert.assertEquals(capability.getCapability("unexpectedAlertBehaviour"), "ignore");
}
use of org.openqa.selenium.remote.DesiredCapabilities in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityHtmlUnitTest.
@Test
public void setupBrowserCapabilityHtmlUnitTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.HTMLUNIT);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "htmlunit");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "htmlunit");
}
use of org.openqa.selenium.remote.DesiredCapabilities in project selenified by Coveros.
the class TestSetupTest method setupBrowserCapabilityEdgeTest.
@Test
public void setupBrowserCapabilityEdgeTest() throws InvalidBrowserException {
TestSetup setup = new TestSetup();
setup.setupBrowserCapability(Browser.EDGE);
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertEquals(capability.getBrowserName(), "MicrosoftEdge");
Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "MicrosoftEdge");
}
use of org.openqa.selenium.remote.DesiredCapabilities in project selenified by Coveros.
the class TestSetupTest method setupProxyTest.
@Test
public void setupProxyTest() {
TestSetup setup = new TestSetup();
setup.setupProxy();
DesiredCapabilities capability = setup.getDesiredCapabilities();
Assert.assertFalse(capability.is(CapabilityType.PROXY));
System.setProperty("proxy", "localhost");
setup.setupProxy();
capability = setup.getDesiredCapabilities();
Proxy export = (Proxy) capability.getCapability(CapabilityType.PROXY);
Assert.assertEquals(export.getHttpProxy(), "localhost");
}
Aggregations