Search in sources :

Example 46 with Call

use of com.coveros.selenified.services.Call in project selenified by Coveros.

the class ServicesResponseVerifyEqualsIT method verifyJsonObjectIsntArray.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void verifyJsonObjectIsntArray() {
    JsonArray json = new JsonArray();
    json.add(json4);
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("posts/?id=4").verifyEquals().arrayData(json);
    // verify 1 issue
    finish(1);
}
Also used : JsonArray(com.google.gson.JsonArray) Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 47 with Call

use of com.coveros.selenified.services.Call in project selenified by Coveros.

the class ServicesResponseVerifyEqualsIT method verifyJsonCrumbsEmpty.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void verifyJsonCrumbsEmpty() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("posts/?id=4").verifyEquals().nestedValue(new ArrayList<>(), json4);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 48 with Call

use of com.coveros.selenified.services.Call in project selenified by Coveros.

the class ServicesResponseVerifyEqualsIT method verifyJsonMessageMessageMismatch.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void verifyJsonMessageMessageMismatch() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Response response = call.get("posts/?id=4");
    response.verifyEquals().message("Something");
    // verify 1 issue
    finish(1);
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 49 with Call

use of com.coveros.selenified.services.Call in project selenified by Coveros.

the class ServicesResponseVerifyEqualsIT method verifyJsonMessageIsntObject.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void verifyJsonMessageIsntObject() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("null/").verifyEquals().objectData(json1);
    // verify 1 issue
    finish(1);
}
Also used : Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 50 with Call

use of com.coveros.selenified.services.Call in project selenified by Coveros.

the class ServicesResponseVerifyEqualsIT method verifyJsonArray.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void verifyJsonArray() {
    JsonArray json = new JsonArray();
    json.add(json1);
    json.add(json2);
    json.add(json3);
    json.add(json4);
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("posts/").verifyEquals().arrayData(json);
    // verify no issues
    finish();
}
Also used : JsonArray(com.google.gson.JsonArray) Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Aggregations

Call (com.coveros.selenified.services.Call)377 Test (org.testng.annotations.Test)375 Request (com.coveros.selenified.services.Request)142 JsonObject (com.google.gson.JsonObject)139 HashMap (java.util.HashMap)94 Response (com.coveros.selenified.services.Response)40 JsonArray (com.google.gson.JsonArray)38 File (java.io.File)21 ArrayList (java.util.ArrayList)14 Hub (com.coveros.selenified.utilities.Hub)10 SessionId (org.openqa.selenium.remote.SessionId)10 HTTP (com.coveros.selenified.services.HTTP)3 App (com.coveros.selenified.application.App)2 JsonParser (com.google.gson.JsonParser)2 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)2 InvalidBrowserException (com.coveros.selenified.exceptions.InvalidBrowserException)1 MalformedURLException (java.net.MalformedURLException)1