Search in sources :

Example 56 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonObjectCorrect.

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

Example 57 with Call

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

the class ServicesResponseAssertEqualsIT method assertArraySizeBad.

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

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

the class ServicesResponseAssertEqualsIT method assertNestArraySizeNotExist.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void assertNestArraySizeNotExist() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Response response = call.get("posts/4");
    response.assertEquals().nestedArraySize(Collections.singletonList("name"), -1);
    // verify no issues
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 59 with Call

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

the class ServicesResponseAssertEqualsIT method assertNestArraySizeGood.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void assertNestArraySizeGood() {
    // 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"), 4);
    // verify no issues
    finish();
}
Also used : Response(com.coveros.selenified.services.Response) Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 60 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonArrayIsntObject.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response", expectedExceptions = AssertionError.class)
public void assertJsonArrayIsntObject() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.get("posts/").assertEquals().objectData(json1);
    // verify 1 issue
    finish(1);
}
Also used : 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