Search in sources :

Example 76 with Call

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

the class ServicesIT method verifySuccessfulDeleteCallEmptyData.

@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters")
public void verifySuccessfulDeleteCallEmptyData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.delete("post/4", new Request()).verifyEquals().objectData(simJson4);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 77 with Call

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

the class ServicesIT method verifySuccessfulBadPutCall.

@Test(groups = { "integration", "service", "httpput", "response" }, description = "An integration test to verify a successful put call with parameters in url")
public void verifySuccessfulBadPutCall() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.put("null/", new Request()).verifyEquals().message("We encountered an error, no page was found");
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 78 with Call

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

the class ServicesIT method verifySuccessfulDeleteCallJsonArrayMultipartData.

@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters")
public void verifySuccessfulDeleteCallJsonArrayMultipartData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.delete("post/4", new Request().setJsonPayload(new JsonArray()).setMultipartData(new HashMap<>())).verifyEquals().objectData(simJson4);
    // verify no issues
    finish();
}
Also used : JsonArray(com.google.gson.JsonArray) Call(com.coveros.selenified.services.Call) HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 79 with Call

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

the class ServicesIT method verifySuccessfulBadDeleteCall.

@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters in url")
public void verifySuccessfulBadDeleteCall() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.delete("null/", new Request()).verifyEquals().message("We encountered an error, no page was found");
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 80 with Call

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

the class ServicesIT method verifySuccessfulPostCallMultipartTrueData.

@Test(groups = { "integration", "service", "httppost", "response" }, description = "An integration test to verify a successful post call with parameters")
public void verifySuccessfulPostCallMultipartTrueData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Map<String, Object> headers = new HashMap<>();
    headers.put("Content-Type", "multipart/form-data;");
    call.addHeaders(headers);
    call.post("post/4", new Request().setMultipartData(new HashMap<>())).verifyEquals().objectData(simJson4);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) 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