use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateEnvironment.
// environment creation
@Test(groups = { "ut" })
public void testCreateEnvironment() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureMockedSnapshotServerConnection();
// reset to be sure it's recreated
connector.setEnvironmentId(null);
connector.createEnvironment();
Assert.assertEquals((int) connector.getEnvironmentId(), 10);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateSnapshot.
@Test(groups = { "ut" })
public void testCreateSnapshot() 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);
Integer snapshotId = connector.createSnapshot(snapshot, sessionId, testCaseInSessionId, stepResultId);
// check prerequisites has been created
Assert.assertEquals((int) sessionId, 13);
Assert.assertEquals((int) snapshotId, 16);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateExcludeZoneServerInactive.
@Test(groups = { "ut" })
public void testCreateExcludeZoneServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
Integer excludeZoneId = connector.createExcludeZones(new Rectangle(1, 1, 1, 1), 0);
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.SNAPSHOT_API_URL));
Assert.assertNull(excludeZoneId);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateApplication.
// application creation
@Test(groups = { "ut" })
public void testCreateApplication() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureMockedSnapshotServerConnection();
// reset to be sure it's recreated
connector.setApplicationId(null);
connector.createApplication();
Assert.assertEquals((int) connector.getApplicationId(), 9);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testGetComparisonResultTakesTooMuchTime.
@Test(groups = { "ut" })
public void testGetComparisonResultTakesTooMuchTime() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
createServerMock("GET", SeleniumRobotSnapshotServerConnector.TESTCASEINSESSION_API_URL + "15", 200, "{'testSteps': [], 'completed': false}");
Integer sessionId = connector.createSession("Session1");
Integer testCaseId = connector.createTestCase("Test 1");
Integer testCaseInSessionId = connector.createTestCaseInSession(sessionId, testCaseId, "Test 1");
StringBuilder errorMessage = new StringBuilder();
int comparisonResult = connector.getTestCaseInSessionComparisonResult(testCaseInSessionId, errorMessage);
Assert.assertEquals(comparisonResult, ITestResult.SKIP);
// no computing error message
Assert.assertTrue(errorMessage.toString().isEmpty());
}
Aggregations