use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateStepReferenceSnapshotNull.
/**
* @throws UnirestException
*/
@Test(groups = { "ut" }, expectedExceptions = SeleniumRobotServerException.class)
public void testCreateStepReferenceSnapshotNull() 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");
Integer testStepId = connector.createTestStep("Step 1", testCaseInSessionId);
Integer stepResultId = connector.recordStepResult(true, "", 1, sessionId, testCaseInSessionId, testStepId);
connector.createStepReferenceSnapshot(null, stepResultId);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testRecordTestLogs.
@Test(groups = { "ut" })
public void testRecordTestLogs() 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.addLogsToTestCaseInSession(testCaseInSessionId, "some logs");
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateApplicationServerInactive.
@Test(groups = { "ut" })
public void testCreateApplicationServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
// reset to be sure it's recreated
connector.setApplicationId(null);
connector.createApplication();
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.APPLICATION_API_URL));
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCheckSnapshotHasNoDifferencesWithOutdatedServer.
/**
* Check the case were seleniumRobot server is not up to date and createSnapshot API only returns id
* @throws UnirestException
*/
@Test(groups = { "ut" })
public void testCheckSnapshotHasNoDifferencesWithOutdatedServer() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
// set it directly has it has been reset on creation
connector.setVersionId(11);
createServerMock("PUT", SeleniumRobotSnapshotServerConnector.SNAPSHOT_API_URL, 200, "{'id': '16'}");
SnapshotComparisonResult snapshotHasNoDifference = connector.checkSnapshotHasNoDifferences(snapshot, "Test 1", "Step 1");
// In case API is not up to date, checkSnapshotHasNoDifferences returns 'NOT_DONE'
Assert.assertEquals(snapshotHasNoDifference, SnapshotComparisonResult.NOT_DONE);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateTestStepServerInactive.
@Test(groups = { "ut" })
public void testCreateTestStepServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
connector.createTestStep("Step 1", 1);
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.TESTSTEP_API_URL));
}
Aggregations