Search in sources :

Example 61 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonMessageMessageNull.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response", expectedExceptions = AssertionError.class)
public void assertJsonMessageMessageNull() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Response response = call.get("/null/");
    response.assertEquals().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 62 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonCrumbsEmpty.

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

Example 63 with Call

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

the class ServicesResponseAssertEqualsIT method negativeSuccessfulGetCall.

// negative checks for assert equals
@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify response code negative responses", expectedExceptions = AssertionError.class)
public void negativeSuccessfulGetCall() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("posts/").assertEquals().code(201);
    // verify 1 issue
    finish(1);
}
Also used : Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 64 with Call

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

the class ServicesResponseAssertEqualsIT method assertNestArraySizeBad.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response", expectedExceptions = AssertionError.class)
public void assertNestArraySizeBad() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Response response = call.get("ids/");
    response.assertEquals().nestedArraySize(Collections.singletonList("ids"), 3);
    // 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 65 with Call

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

the class ServicesResponseAssertEqualsIT method assertArraySizeEmpty.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void assertArraySizeEmpty() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Response response = call.get("empty/");
    response.assertEquals().arraySize(0);
    // verify no issues
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) 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