Search in sources :

Example 6 with Hub

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

the class HubTest method defaultGetHubSystemBadTest.

@Test(expectedExceptions = InvalidHubException.class)
public void defaultGetHubSystemBadTest() throws MalformedURLException {
    System.setProperty(HUB, "somehub");
    new Hub().getHubURL();
}
Also used : Hub(com.coveros.selenified.utilities.Hub) Test(org.testng.annotations.Test)

Example 7 with Hub

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

the class HubTest method defaultGetHubSystemEmptyTest.

@Test(expectedExceptions = InvalidHubException.class)
public void defaultGetHubSystemEmptyTest() throws MalformedURLException {
    System.setProperty(HUB, "");
    new Hub().getHubURL();
}
Also used : Hub(com.coveros.selenified.utilities.Hub) Test(org.testng.annotations.Test)

Example 8 with Hub

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

the class HubTest method defaultGetHubOverrideTrueTest.

@Test
public void defaultGetHubOverrideTrueTest() throws IOException {
    System.setProperty(HUB, "http://somehub");
    createPropertiesFile(HUB + "=");
    assertEquals(new Hub().getHubURL(), new URL("http://somehub/wd/hub"));
}
Also used : Hub(com.coveros.selenified.utilities.Hub) URL(java.net.URL) Test(org.testng.annotations.Test)

Example 9 with Hub

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

the class HubTest method getUserOnlyUserTest.

@Test(expectedExceptions = InvalidHubException.class)
public void getUserOnlyUserTest() throws MalformedURLException {
    System.setProperty(HUB, "https://sauceusername@ondemand.saucelabs.com:443");
    new Hub().getUsername();
}
Also used : Hub(com.coveros.selenified.utilities.Hub) Test(org.testng.annotations.Test)

Example 10 with Hub

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

the class SauceIT method sauceBuildTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that sauce get all expected information")
public void sauceBuildTest(ITestContext iTestContext) throws IOException {
    SessionId sessionId = (SessionId) iTestContext.getAttribute("HUB_SESSION_ID");
    String buildName = iTestContext.getAttribute("HUB_BUILD").toString();
    Hub hub = new Hub();
    Call call = this.calls.get();
    call.addCredentials(hub.getUsername(), hub.getPassword());
    Response response = call.get("rest/v1/" + hub.getUsername() + "/jobs/" + sessionId.toString());
    Map<String, Object> expectedResults = new HashMap<>();
    expectedResults.put("build", buildName);
    response.assertContains().keyValues(expectedResults);
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Hub(com.coveros.selenified.utilities.Hub) HashMap(java.util.HashMap) SessionId(org.openqa.selenium.remote.SessionId) Test(org.testng.annotations.Test)

Aggregations

Hub (com.coveros.selenified.utilities.Hub)24 Test (org.testng.annotations.Test)24 Call (com.coveros.selenified.services.Call)10 Response (com.coveros.selenified.services.Response)10 SessionId (org.openqa.selenium.remote.SessionId)10 HashMap (java.util.HashMap)6 URL (java.net.URL)4 ArrayList (java.util.ArrayList)4 JsonArray (com.google.gson.JsonArray)1