Search in sources :

Example 51 with Call

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

the class ServicesResponseVerifyEqualsIT method verifyJsonArrayMessage.

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

Example 52 with Call

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

the class ServicesOverrideIT method overrideCredentialsTest.

@Test(groups = { "integration", "service", "headers" }, description = "An integration test to verify we can successfully override standard header values")
public void overrideCredentialsTest() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // set some custom credentials
    call.addCredentials("hello", "world");
    // perform some actions
    call.get("posts/").verifyEquals().code(200);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 53 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonMessageIsntObject.

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

Example 54 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonObjectMismatch.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response", expectedExceptions = AssertionError.class)
public void assertJsonObjectMismatch() {
    // 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(json1);
    // verify 1 issue
    finish(1);
}
Also used : Call(com.coveros.selenified.services.Call) Test(org.testng.annotations.Test)

Example 55 with Call

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

the class ServicesResponseAssertEqualsIT method assertJsonCrumbsSingle.

@Test(groups = { "integration", "service", "httpget", "response" }, description = "An integration test to verify json data response")
public void assertJsonCrumbsSingle() {
    List<String> crumbs = new ArrayList<>();
    crumbs.add("userId");
    // 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(crumbs, 1);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) ArrayList(java.util.ArrayList) 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