Search in sources :

Example 16 with SeleniumRobotVariableServerConnector

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

the class TestSeleniumRobotVariableServerConnector method testGetApplicationIdWithoutToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testGetApplicationIdWithoutToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
    Assert.assertEquals(connector.getApplicationId(), 1);
    verify(namedApplicationRequest, never()).header(eq("Authorization"), anyString());
}
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 17 with SeleniumRobotVariableServerConnector

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

the class TestSeleniumRobotVariableServerConnector method testGetEnvironmentIdWithToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testGetEnvironmentIdWithToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", "123");
    Assert.assertEquals(connector.getEnvironmentId(), 2);
    verify(namedEnvironmentRequest, 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 18 with SeleniumRobotVariableServerConnector

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

the class TestSeleniumRobotVariableServerConnector method testCreateApplicationWithoutToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testCreateApplicationWithoutToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
    connector.createApplication();
    verify(createApplicationRequest, never()).header(eq("Authorization"), anyString());
}
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 19 with SeleniumRobotVariableServerConnector

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

the class TestSeleniumRobotVariableServerConnector method testGetVersionIdWithoutToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testGetVersionIdWithoutToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
    Assert.assertEquals(connector.getVersionId(), 4);
    verify(namedVersionRequest, never()).header(eq("Authorization"), anyString());
}
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 20 with SeleniumRobotVariableServerConnector

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

the class TestSeleniumRobotVariableServerConnector method testGetEnvironmentIdWithoutToken.

/**
 * Check tokens are not added to request when not provided
 * @throws UnirestException
 */
@Test(groups = { "ut" })
public void testGetEnvironmentIdWithoutToken() throws UnirestException {
    configureMockedVariableServerConnection();
    SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
    Assert.assertEquals(connector.getEnvironmentId(), 2);
    verify(namedEnvironmentRequest, never()).header(eq("Authorization"), anyString());
}
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