use of com.seleniumtests.core.SeleniumTestsContext in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testPlatformParsingForIOS.
@Test(groups = { "ut context" })
public void testPlatformParsingForIOS(final ITestContext testNGCtx, final XmlTest xmlTest) {
try {
System.setProperty("platform", "iOS 9.01");
System.setProperty("deviceName", "");
initThreadContext(testNGCtx);
SeleniumTestsContext seleniumTestsCtx = SeleniumTestsContextManager.getThreadContext();
Assert.assertEquals(seleniumTestsCtx.getPlatform(), "iOS");
Assert.assertEquals(seleniumTestsCtx.getMobilePlatformVersion(), "9.01");
} finally {
System.clearProperty("platform");
System.clearProperty("deviceName");
}
}
use of com.seleniumtests.core.SeleniumTestsContext in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testUserDefinedParam.
/**
* If parameter is defined in test and as JVM parameter (user defined), the user defined parameter must be used
*/
@Test(groups = { "ut context" })
public void testUserDefinedParam(final ITestContext testNGCtx, final XmlTest xmlTest) {
try {
System.setProperty("dpTagsInclude", "anOtherTag");
initThreadContext(testNGCtx);
SeleniumTestsContext seleniumTestsCtx = SeleniumTestsContextManager.getThreadContext();
Assert.assertEquals(seleniumTestsCtx.getDPTagsInclude(), "anOtherTag");
} finally {
System.clearProperty("dpTagsInclude");
}
}
use of com.seleniumtests.core.SeleniumTestsContext in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testSuiteLevelParam.
/**
* If parameter is only defined in test suite, it's correctly read
*/
@Test(groups = { "ut context" })
public void testSuiteLevelParam(final ITestContext testNGCtx, final XmlTest xmlTest) {
initThreadContext(testNGCtx);
SeleniumTestsContext seleniumTestsCtx = SeleniumTestsContextManager.getThreadContext();
Assert.assertEquals(seleniumTestsCtx.getImplicitWaitTimeout(), 2);
}
use of com.seleniumtests.core.SeleniumTestsContext in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testProxyPresetCaptureNetworkWithManual.
@Test(groups = "ut context")
public void testProxyPresetCaptureNetworkWithManual(final ITestContext testNGCtx, final XmlTest xmlTest) {
SeleniumTestsContextManager.generateApplicationPath(testNGCtx.getCurrentXmlTest().getSuite());
SeleniumTestsContext seleniumContext = new SeleniumTestsContext();
seleniumContext.setCaptureNetwork(true);
seleniumContext.setWebProxyType("MANUAL");
seleniumContext.setConfiguration(new HashMap<>());
seleniumContext.setTestConfiguration();
seleniumContext.updateProxyConfig();
Assert.assertEquals(seleniumContext.getWebProxyType(), ProxyType.MANUAL);
}
use of com.seleniumtests.core.SeleniumTestsContext in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testTestLevelParam.
/**
* If parameter is defined in test suite and test, the test parameter must override suite parameter
*/
@Test(groups = { "ut context" })
public void testTestLevelParam(final ITestContext testNGCtx, final XmlTest xmlTest) {
initThreadContext(testNGCtx);
SeleniumTestsContext seleniumTestsCtx = SeleniumTestsContextManager.getThreadContext();
Assert.assertEquals(seleniumTestsCtx.getApp(), "https://www.google.fr");
}
Aggregations