Search in sources :

Example 16 with Hub

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

the class LambdaTestIT method lambdaBuildTest.

@Test(groups = { "integration", "hub", "lambda", "lambdaAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that lambda get all expected information")
public void lambdaBuildTest(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("sessions/" + sessionId.toString());
    List<String> jsonDataSets = new ArrayList<>();
    jsonDataSets.add("data");
    jsonDataSets.add("build_name");
    response.assertEquals().nestedValue(jsonDataSets, buildName);
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Hub(com.coveros.selenified.utilities.Hub) ArrayList(java.util.ArrayList) SessionId(org.openqa.selenium.remote.SessionId) Test(org.testng.annotations.Test)

Example 17 with Hub

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

the class LambdaTestIT method lambdaPassedTest.

@Test(groups = { "integration", "hub", "lambda", "lambdaAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that lambda get all expected information")
public void lambdaPassedTest(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("sessions/" + sessionId.toString());
    List<String> jsonDataSets = new ArrayList<>();
    jsonDataSets.add("data");
    jsonDataSets.add("status_ind");
    response.assertEquals().nestedValue(jsonDataSets, "passed");
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Hub(com.coveros.selenified.utilities.Hub) ArrayList(java.util.ArrayList) SessionId(org.openqa.selenium.remote.SessionId) Test(org.testng.annotations.Test)

Example 18 with Hub

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

the class LambdaTestIT method lambdaNameTest.

@Test(groups = { "integration", "hub", "lambda", "lambdaAPI" }, dependsOnMethods = { "hubTitleTest" }, description = "An integration test to check that lambda get all expected information")
public void lambdaNameTest(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("sessions/" + sessionId.toString());
    List<String> jsonDataSets = new ArrayList<>();
    jsonDataSets.add("data");
    jsonDataSets.add("name");
    response.assertEquals().nestedValue(jsonDataSets, "integration.hub.LambdaTestIT.hubTitleTest");
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Hub(com.coveros.selenified.utilities.Hub) ArrayList(java.util.ArrayList) SessionId(org.openqa.selenium.remote.SessionId) Test(org.testng.annotations.Test)

Example 19 with Hub

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

the class LambdaTestIT method lambdaComplexNameTest.

@Test(groups = { "integration", "hub", "lambda", "lambdaAPI" }, dependsOnMethods = { "hubSearchTest" }, description = "An integration test to check that lambda get all expected information")
public void lambdaComplexNameTest(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("sessions/" + paramSessionId.toString());
    List<String> jsonDataSets = new ArrayList<>();
    jsonDataSets.add("data");
    jsonDataSets.add("name");
    response.assertEquals().nestedValue(jsonDataSets, "integration.hub.LambdaTestIT.hubSearchTestWithOptionHi");
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Hub(com.coveros.selenified.utilities.Hub) ArrayList(java.util.ArrayList) SessionId(org.openqa.selenium.remote.SessionId) Test(org.testng.annotations.Test)

Example 20 with Hub

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

the class HubTest method defaultGetHubFileTrueTest.

@Test
public void defaultGetHubFileTrueTest() throws IOException {
    createPropertiesFile(HUB + "=https://somehub");
    assertEquals(new Hub().getHubURL(), new URL("https://somehub/wd/hub"));
}
Also used : Hub(com.coveros.selenified.utilities.Hub) URL(java.net.URL) 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