use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method checkNewResponseArrayArrayTest.
@Test
public void checkNewResponseArrayArrayTest() {
JsonArray json = new JsonArray();
Response response = new Response(5, json, "");
Assert.assertEquals(response.getArrayData(), json);
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method confirmEqualsCodeFailTest.
@Test
public void confirmEqualsCodeFailTest() throws IOException {
JsonObject json = new JsonObject();
json.addProperty("name", "john");
Response response = new Response(5, json, "");
response.setOutputFile(outputFile);
response.assertEquals(6);
String content = Files.toString(file, Charsets.UTF_8);
Assert.assertTrue(content.matches("[.\\s\\S]+ <tr>\n <td align='center'>1.</td>\n <td> </td>\n <td>Expected to find a response code of <b>6</b></td>\n <td>Found a response code of <b>5</b></td>\n <td>[0-9]+ms / [0-9]+ms</td>\n <td class='fail'>Fail</td>\n </tr>\n"));
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method confirmContainsPairsNullTest.
@Test
public void confirmContainsPairsNullTest() throws IOException {
JsonArray json = new JsonArray();
json.add("name");
Response response = new Response(5, json, "");
response.setOutputFile(outputFile);
Map<String, String> pairs = new HashMap<>();
pairs.put("name1", "john");
response.assertContains(pairs);
String content = Files.toString(file, Charsets.UTF_8);
Assert.assertTrue(content.matches("[.\\s\\S]+ <tr>\n <td align='center'>1.</td>\n <td> </td>\n <td>Expected to find a response containing: <div><i><div>name1 : john</div></i></div></td>\n <td>Found a response of:<div><i>\\[<br/>\\ \\ \"name\"<br/>\\]</i></div></td>\n <td>[0-9]+ms / [0-9]+ms</td>\n <td class='fail'>Fail</td>\n </tr>\n"));
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method checkNewResponseArrayMessageTest.
@Test
public void checkNewResponseArrayMessageTest() {
JsonArray json = new JsonArray();
Response response = new Response(5, json, "");
Assert.assertEquals(response.getMessage(), "");
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method confirmEqualsArrayFailTest.
@Test
public void confirmEqualsArrayFailTest() throws IOException {
JsonArray json = new JsonArray();
json.add("name");
Response response = new Response(5, json, "");
response.setOutputFile(outputFile);
response.assertEquals(new JsonArray());
String content = Files.toString(file, Charsets.UTF_8);
Assert.assertTrue(content.matches("[.\\s\\S]+ <tr>\n <td align='center'>1.</td>\n <td> </td>\n <td>Expected to find a response of:<div><i>\\[\\]</i></div></td>\n <td>Found a response of:<div><i>\\[<br/>\\ \\ \"name\"<br/>\\]</i></div></td>\n <td>[0-9]+ms / [0-9]+ms</td>\n <td class='fail'>Fail</td>\n </tr>\n"));
}
Aggregations