use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ReadmeSampleIT method sampleServicesSearchTest.
@Test(groups = { "sample", "service", "coveros", "https" }, description = "A sample web services test to verify the response code")
public void sampleServicesSearchTest() {
HashMap<String, Object> params = new HashMap<>();
params.put("s", "Max+Saperstone");
// use this object to verify the app looks as expected
Call call = this.calls.get();
// retrieve the zip code and verify the return code
call.get("", new Request().setUrlParams(params)).assertEquals().code(403);
// verify no issues
finish();
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class LambdaTest method updateStatus.
/**
* Connects with Lambda Test and updates the status in their system to the test result
* status
*
* @param result - the testng itestresult object
*/
static void updateStatus(ITestResult result) {
if (isLambdaTest() && result.getAttributeNames().contains(SESSION_ID)) {
String sessionId = result.getAttribute(SESSION_ID).toString();
JsonObject json = new JsonObject();
String status = (result.getStatus() == 1) ? "passed" : "failed";
json.addProperty("status_ind", status);
try {
LambdaTest lambdaTest = new LambdaTest();
HTTP http = new HTTP(null, "https://api.lambdatest.com/automation/api/v1/", lambdaTest.getUsername(), lambdaTest.getPassword());
http.patch("sessions/" + sessionId, new Request().setJsonPayload(json), null);
} catch (MalformedURLException e) {
log.error("Unable to connect to lambda test, due to credential problems");
} catch (IOException e) {
log.error(e);
}
}
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ServicesErrorIT method comparePutResponseCode200Test.
@Test(groups = { "integration", "service", "httpput", "https" }, description = "An integration test to verify the response code from a put call")
public void comparePutResponseCode200Test() {
// use this object to verify the app looks as expected
Call call = this.calls.get();
// perform some actions
call.put("posts/3", new Request()).verifyEquals().code(200);
// verify 1 issue
finish(1);
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ServicesErrorIT method compareDeleteResponseCode200Test.
@Test(groups = { "integration", "service", "httpdelete", "https" }, description = "An integration test to verify the response code from a delete call")
public void compareDeleteResponseCode200Test() {
// use this object to verify the app looks as expected
Call call = this.calls.get();
// perform some actions
call.delete("posts/5", new Request()).verifyEquals().code(200);
// verify 1 issue
finish(1);
}
use of com.coveros.selenified.services.Request in project selenified by Coveros.
the class ServicesErrorIT method comparePostResponseCode201Test.
@Test(groups = { "integration", "service", "httppost", "https" }, description = "An integration test to verify the response code from a post call")
public void comparePostResponseCode201Test() {
// use this object to verify the app looks as expected
Call call = this.calls.get();
// perform some actions
call.post("posts/", new Request()).verifyEquals().code(201);
// verify 1 issue
finish(1);
}
Aggregations