Search in sources :

Example 11 with Hub

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

the class SauceIT method sauceNameTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that sauce get all expected information")
public void sauceNameTest(ITestContext iTestContext) throws IOException {
    SessionId sessionId = (SessionId) iTestContext.getAttribute("HUB_SESSION_ID");
    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("name", "integration.hub.SauceIT.hubTitleTest");
    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)

Example 12 with Hub

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

the class SauceIT method sauceSeleniumVersionTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that sauce get all expected information")
public void sauceSeleniumVersionTest(ITestContext iTestContext) throws IOException {
    SessionId sessionId = (SessionId) iTestContext.getAttribute("HUB_SESSION_ID");
    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("selenium_version", System.getProperty("selenium.version"));
    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)

Example 13 with Hub

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

the class SauceIT method saucePassedTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that sauce get all expected information")
public void saucePassedTest(ITestContext iTestContext) throws IOException {
    SessionId sessionId = (SessionId) iTestContext.getAttribute("HUB_SESSION_ID");
    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("passed", true);
    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)

Example 14 with Hub

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

the class SauceIT method sauceTagsTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that sauce get all expected information")
public void sauceTagsTest(ITestContext iTestContext) throws IOException {
    SessionId sessionId = (SessionId) iTestContext.getAttribute("HUB_SESSION_ID");
    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<>();
    JsonArray tags = new JsonArray();
    tags.add("hub");
    tags.add("integration");
    tags.add("sauce");
    expectedResults.put("tags", tags);
    response.assertContains().keyValues(expectedResults);
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) JsonArray(com.google.gson.JsonArray) 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)

Example 15 with Hub

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

the class SauceIT method sauceComplexNameTest.

@Test(groups = { "integration", "hub", "sauce", "sauceAPI" }, dependsOnMethods = { "hubSearchTest" }, description = "An integration test to check that sauce get all expected information")
public void sauceComplexNameTest(ITestContext iTestContext) throws IOException {
    SessionId paramSessionId = (SessionId) iTestContext.getAttribute("PARAM_SESSION_ID");
    Hub hub = new Hub();
    Call call = this.calls.get();
    call.addCredentials(hub.getUsername(), hub.getPassword());
    Response response = call.get("rest/v1/" + hub.getUsername() + "/jobs/" + paramSessionId.toString());
    Map<String, Object> expectedResults = new HashMap<>();
    expectedResults.put("name", "integration.hub.SauceIT.hubSearchTestWithOptionSelenifiedcoveroscom");
    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