use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateTestStepLongName.
@Test(groups = { "ut" })
public void testCreateTestStepLongName() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
HttpRequestWithBody request = (HttpRequestWithBody) createServerMock("POST", SeleniumRobotSnapshotServerConnector.TESTSTEP_API_URL, 200, "{'id': '9'}", "request");
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" + StringUtils.repeat("-", 95), testCaseInSessionId);
verify(request).field("name", ("Step 1" + StringUtils.repeat("-", 94)));
Assert.assertEquals((int) testStepId, 9);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateTestCaseLongName.
/**
* Test case name is limited to 150 chars by server, check we strip it
* @throws UnirestException
*/
@Test(groups = { "ut" })
public void testCreateTestCaseLongName() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
MultipartBody request = (MultipartBody) createServerMock("POST", SeleniumRobotSnapshotServerConnector.TESTCASE_API_URL, 200, "{'id': '14'}", "body");
connector.createApplication();
Integer testCaseId = connector.createTestCase("Test 1" + StringUtils.repeat("-", 145));
verify(request).field("name", ("Test 1" + StringUtils.repeat("-", 144)));
Assert.assertEquals((int) testCaseId, 14);
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateTestCaseInSessionServerInactive.
@Test(groups = { "ut" })
public void testCreateTestCaseInSessionServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
Integer testCaseInSessionId = connector.createTestCaseInSession(1, 1, "Test 1");
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.TESTCASEINSESSION_API_URL));
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateEnvironmentServerInactive.
@Test(groups = { "ut" })
public void testCreateEnvironmentServerInactive() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = configureNotAliveConnection();
// reset to be sure it's recreated
connector.setEnvironmentId(null);
connector.createEnvironment();
PowerMockito.verifyStatic(Unirest.class, never());
Unirest.post(ArgumentMatchers.contains(SeleniumRobotSnapshotServerConnector.ENVIRONMENT_API_URL));
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotSnapshotServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotSnapshotServerConnector method testCreateSessionEnvironmentNull.
// session creation => as environment is not defined, error raised
@Test(groups = { "ut" }, expectedExceptions = SeleniumRobotServerException.class)
public void testCreateSessionEnvironmentNull() throws UnirestException {
SeleniumRobotSnapshotServerConnector connector = spy(configureMockedSnapshotServerConnection());
// reset to be sure it's recreated
connector.setEnvironmentId(null);
connector.createSession("Session1");
}
Aggregations