Search in sources :

Example 1 with TestSetup

use of com.coveros.selenified.utilities.TestSetup 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 2 with TestSetup

use of com.coveros.selenified.utilities.TestSetup 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 3 with TestSetup

use of com.coveros.selenified.utilities.TestSetup 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)

Example 4 with TestSetup

use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.

the class TestSetupTest method setupBrowserDetailsBrowserNameIllegalBrowserTest.

@Test(expectedExceptions = IllegalArgumentException.class)
public void setupBrowserDetailsBrowserNameIllegalBrowserTest() {
    Map<String, String> browserDetails = new HashMap<>();
    browserDetails.put("browserName", "BadBrowser");
    TestSetup setup = new TestSetup();
    setup.setupBrowserDetails(browserDetails);
}
Also used : TestSetup(com.coveros.selenified.utilities.TestSetup) HashMap(java.util.HashMap) Test(org.testng.annotations.Test)

Example 5 with TestSetup

use of com.coveros.selenified.utilities.TestSetup in project selenified by Coveros.

the class TestSetupTest method setupBrowserCapabilityInternetExplorerTest.

@Test
public void setupBrowserCapabilityInternetExplorerTest() throws InvalidBrowserException {
    TestSetup setup = new TestSetup();
    setup.setupBrowserCapability(Browser.INTERNETEXPLORER);
    DesiredCapabilities capability = setup.getDesiredCapabilities();
    Assert.assertEquals(capability.getBrowserName(), "internet explorer");
    Assert.assertEquals(capability.getCapability(CapabilityType.BROWSER_NAME), "internet explorer");
}
Also used : TestSetup(com.coveros.selenified.utilities.TestSetup) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.testng.annotations.Test)

Aggregations

TestSetup (com.coveros.selenified.utilities.TestSetup)20 Test (org.testng.annotations.Test)20 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)17 HashMap (java.util.HashMap)7 Proxy (org.openqa.selenium.Proxy)1