Search in sources :

Example 51 with Request

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

the class ReporterTest method outputRequestPropertiesParamsTest.

@Test
public void outputRequestPropertiesParamsTest() {
    Map<String, Object> map = new HashMap<>();
    map.put("hello", "world");
    Request request = new Request().setUrlParams(map);
    assertEquals(Reporter.getRequestPayloadOutput(request, null), "");
}
Also used : HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 52 with Request

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

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

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

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

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