Search in sources :

Example 56 with Request

use of com.coveros.selenified.services.Request 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)

Example 57 with Request

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

the class ServicesIT method verifySuccessfulPutCallJsonArrayData.

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

Example 58 with Request

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

the class ServicesIT method verifySuccessfulDeleteCall.

// for delete calls
@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters")
public void verifySuccessfulDeleteCall() {
    // 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().code(200);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 59 with Request

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

the class ServicesIT method verifySuccessfulPatchCallNoDataWithFile.

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

Example 60 with Request

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

the class ServicesIT method verifySuccessfulPostCallUrlParamsData.

@Test(groups = { "integration", "service", "httppost", "response" }, description = "An integration test to verify a successful post call with parameters")
public void verifySuccessfulPostCallUrlParamsData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.post("post/4", new Request().setUrlParams(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) Test(org.testng.annotations.Test)

Aggregations

Request (com.coveros.selenified.services.Request)198 Test (org.testng.annotations.Test)197 Call (com.coveros.selenified.services.Call)142 JsonObject (com.google.gson.JsonObject)115 HashMap (java.util.HashMap)102 File (java.io.File)32 JsonArray (com.google.gson.JsonArray)30 HTTP (com.coveros.selenified.services.HTTP)5 JsonParser (com.google.gson.JsonParser)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1