Search in sources :

Example 21 with SeleniumRobotVariableServerConnector

use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.

the class TestSeleniumRobotVariableServerConnector method init.

@BeforeMethod(groups = { "it" })
public void init(ITestContext ctx) {
    initThreadContext(ctx);
    connector = new SeleniumRobotVariableServerConnector(true, "http://localhost:8002", "Test 1", "37023c02b9df77b5e5939cca85bc2f20cd3d001d");
    if (!connector.getActive()) {
        throw new SkipException("no seleniumrobot server available");
    }
}
Also used : SeleniumRobotVariableServerConnector(com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector) SkipException(org.testng.SkipException) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 22 with SeleniumRobotVariableServerConnector

use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.

the class TestSeleniumRobotVariableServerConnector method testCreateTestCaseWithToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testCreateTestCaseWithToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", "123");
    connector.createTestCase("foo");
    verify(createTestCaseRequest, times(2)).header("Authorization", "Token 123");
}
Also used : SeleniumRobotVariableServerConnector(com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 23 with SeleniumRobotVariableServerConnector

use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.

the class TestSeleniumRobotVariableServerConnector method testCreateApplicationWithToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testCreateApplicationWithToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", "123");
    connector.createApplication();
    verify(createApplicationRequest, times(1)).header("Authorization", "Token 123");
}
Also used : SeleniumRobotVariableServerConnector(com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 24 with SeleniumRobotVariableServerConnector

use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.

the class TestSeleniumRobotVariableServerConnector method testServerActiveNotAlive.

@Test(groups = { "ut" })
public void testServerActiveNotAlive() throws UnirestException {
    SeleniumRobotVariableServerConnector connector = configureNotAliveConnection();
    Assert.assertFalse(connector.getActive());
}
Also used : SeleniumRobotVariableServerConnector(com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 25 with SeleniumRobotVariableServerConnector

use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.

the class TestSeleniumRobotVariableServerConnector method testServerActiveAliveAndSecuredWithoutToken.

@Test(groups = { "ut" })
public void testServerActiveAliveAndSecuredWithoutToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
    verify(getAliveRequest, never()).header("Authorization", "Token 123");
}
Also used : SeleniumRobotVariableServerConnector(com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector) Test(org.testng.annotations.Test) ConnectorsTest(com.seleniumtests.ConnectorsTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

SeleniumRobotVariableServerConnector (com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector)36 ConnectorsTest (com.seleniumtests.ConnectorsTest)34 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)34 Test (org.testng.annotations.Test)34 TestVariable (com.seleniumtests.core.TestVariable)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 HttpRequest (kong.unirest.HttpRequest)2 ScenarioException (com.seleniumtests.customexception.ScenarioException)1 ArrayList (java.util.ArrayList)1 SkipException (org.testng.SkipException)1 BeforeMethod (org.testng.annotations.BeforeMethod)1