use of com.seleniumtests.core.TestVariable in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testAttributeFoundInVariableButNotRequested.
@Test(groups = "ut context")
public void testAttributeFoundInVariableButNotRequested(final ITestContext testNGCtx, final XmlTest xmlTest) {
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("foo2", new TestVariable("foo2", "bar2"));
SeleniumTestsContextManager.getThreadContext().setAttribute("foo", "bar");
Assert.assertEquals(SeleniumTestsContextManager.getThreadContext().getAttribute("foo2"), null);
}
use of com.seleniumtests.core.TestVariable in project seleniumRobot by bhecquet.
the class TestSeleniumTestContext method testAttributeFoundInVariablePriority.
@Test(groups = "ut context")
public void testAttributeFoundInVariablePriority(final ITestContext testNGCtx, final XmlTest xmlTest) {
initThreadContext(testNGCtx);
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("foo", new TestVariable("foo", "bar2"));
SeleniumTestsContextManager.getThreadContext().setAttribute("foo", "bar");
Assert.assertEquals(SeleniumTestsContextManager.getThreadContext().getAttribute("foo", true), "bar");
}
use of com.seleniumtests.core.TestVariable in project seleniumRobot by bhecquet.
the class TestFixture method testGetValueWithKnownParam.
@Test(groups = { "ut" })
public void testGetValueWithKnownParam() {
SeleniumTestsContextManager.getGlobalContext().setCucumberImplementationPackage("com.seleniumtests.ut.core.runner.cucumber");
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("foo", new TestVariable("foo", "bar"));
Assert.assertEquals(new Fixture().getValue("{{ foo }}"), "bar");
}
use of com.seleniumtests.core.TestVariable in project seleniumRobot by bhecquet.
the class TestStringUtility method testInterpolateStringVariableInVariable.
/**
* Test the case where a variable contains a reference to an other one
*/
@Test(groups = { "ut" })
public void testInterpolateStringVariableInVariable() {
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("url", new TestVariable("url", "http://mysite${path}"));
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("path", new TestVariable("path", "/foo/bar${param}"));
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("param", new TestVariable("param", "?key=value"));
Assert.assertEquals(StringUtility.interpolateString("connect to ${url}", SeleniumTestsContextManager.getThreadContext()), "connect to http://mysite/foo/bar?key=value");
}
use of com.seleniumtests.core.TestVariable in project seleniumRobot by bhecquet.
the class TestStringUtility method testInterpolateStringMaskPassword3.
@Test(groups = { "ut" })
public void testInterpolateStringMaskPassword3() {
SeleniumTestsContextManager.getThreadContext().setMaskPassword(true);
SeleniumTestsContextManager.getThreadContext().getConfiguration().put("pwd", new TestVariable("pwd", "abc"));
Assert.assertEquals(StringUtility.interpolateString("connect with ${pwd}", SeleniumTestsContextManager.getThreadContext()), "connect with ****");
}
Aggregations