use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testRecordTestLogsNoTestCaseInSession.
// add logs to test case in session
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testRecordTestLogsNoTestCaseInSession() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
connector.addLogsToTestCaseInSession(null, "some logs");
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateSnapshotNoStepResult.
// snapshot creation
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testCreateSnapshotNoStepResult() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
Integer sessionId = connector.createSession("Session1");
Integer testCaseId = connector.createTestCase("Test 1");
Integer testCaseInSessionId = connector.createTestCaseInSession(sessionId, testCaseId, "Test 1");
connector.createSnapshot(snapshot, sessionId, testCaseInSessionId, null);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateStepResultInError.
@Test(groups = { "ut" }, expectedExceptions = SeleniumRobotServerException.class)
public void testCreateStepResultInError() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureMockedSnapshotServerConnection();
HttpRequest<HttpRequest> req = createServerMock("POST", SeleniumRobotSnapshotServerConnector.STEPRESULT_API_URL, 200, "{'id': '9'}", "body");
when(req.asString()).thenThrow(UnirestException.class);
Integer sessionId = connector.createSession("Session1");
Integer testCaseId = connector.createTestCase("Test 1");
Integer testCaseInSessionId = connector.createTestCaseInSession(sessionId, testCaseId, "Test 1");
Integer testStepId = connector.createTestStep("Step 1", testCaseInSessionId);
Integer stepResultId = connector.recordStepResult(true, "", 1, sessionId, testCaseInSessionId, testStepId);
Assert.assertNull(stepResultId);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateTestCaseServerInactive.
@Test(groups = { "ut" })
public void testCreateTestCaseServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
connector.createTestCase("Test 1");
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.TESTCASE_API_URL));
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testRecordTestLogsInError.
@Test(groups = { "ut" }, expectedExceptions = SeleniumRobotServerException.class)
public void testRecordTestLogsInError() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureMockedSnapshotServerConnection();
HttpRequest<HttpRequest> req = createServerMock("PATCH", SeleniumRobotSnapshotServerConnector.TESTCASEINSESSION_API_URL + "15/", 200, "{'id': '9'}", "body");
when(req.asString()).thenThrow(UnirestException.class);
Integer sessionId = connector.createSession("Session1");
Integer testCaseId = connector.createTestCase("Test 1");
Integer testCaseInSessionId = connector.createTestCaseInSession(sessionId, testCaseId, "Test 1");
connector.addLogsToTestCaseInSession(testCaseInSessionId, "some logs");
}
Aggregations