Search in sources :

Example 16 with DesiredCapabilities

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();
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 17 with DesiredCapabilities

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");
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.testng.annotations.Test)

Example 18 with DesiredCapabilities

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");
}
Also used : TestSetup(com.coveros.selenified.utilities.TestSetup) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.testng.annotations.Test)

Example 19 with DesiredCapabilities

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");
}
Also used : TestSetup(com.coveros.selenified.utilities.TestSetup) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.testng.annotations.Test)

Example 20 with DesiredCapabilities

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");
}
Also used : TestSetup(com.coveros.selenified.utilities.TestSetup) Proxy(org.openqa.selenium.Proxy) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.testng.annotations.Test)

Aggregations

DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)178 File (java.io.File)55 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)40 URL (java.net.URL)34 HashMap (java.util.HashMap)34 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)30 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)29 Test (org.testng.annotations.Test)22 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)20 BeforeClass (org.junit.BeforeClass)19 TestSetup (com.coveros.selenified.utilities.TestSetup)17 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)17 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)16 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)14 MalformedURLException (java.net.MalformedURLException)13 Before (org.junit.Before)13 Test (org.junit.Test)13 InternetExplorerDriver (org.openqa.selenium.ie.InternetExplorerDriver)12 Actions (org.openqa.selenium.interactions.Actions)12 Dimension (org.openqa.selenium.Dimension)11