Search in sources :

Example 1 with Fixture

use of com.seleniumtests.core.runner.cucumber.Fixture in project seleniumRobot by bhecquet.

the class TestFixture method testGetElement.

/**
 * Check we can get an element, if present
 */
@Test(groups = { "ut" })
public void testGetElement() {
    SeleniumTestsContextManager.getGlobalContext().setCucumberImplementationPackage("com.seleniumtests.ut.core.runner.cucumber");
    Assert.assertTrue(new Fixture().getElement("textField").equals("textField"));
    Assert.assertTrue(Fixture.getCurrentPage() instanceof PageForActions);
}
Also used : Fixture(com.seleniumtests.core.runner.cucumber.Fixture) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 2 with Fixture

use of com.seleniumtests.core.runner.cucumber.Fixture in project seleniumRobot by bhecquet.

the class TestFixture method testGetElementNotPresent.

/**
 * Check we get exception if element is not found
 */
@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class)
public void testGetElementNotPresent() {
    SeleniumTestsContextManager.getGlobalContext().setCucumberImplementationPackage("com.seleniumtests.ut.core.runner.cucumber");
    new Fixture().getElement("textFoo");
}
Also used : Fixture(com.seleniumtests.core.runner.cucumber.Fixture) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 3 with Fixture

use of com.seleniumtests.core.runner.cucumber.Fixture 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");
}
Also used : TestVariable(com.seleniumtests.core.TestVariable) Fixture(com.seleniumtests.core.runner.cucumber.Fixture) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 4 with Fixture

use of com.seleniumtests.core.runner.cucumber.Fixture in project seleniumRobot by bhecquet.

the class TestFixture method testGetElementWithClassName.

@Test(groups = { "ut" })
public void testGetElementWithClassName() {
    SeleniumTestsContextManager.getGlobalContext().setCucumberImplementationPackage("com.seleniumtests.ut.core.runner.cucumber");
    Assert.assertTrue(new Fixture().getElement("PageForActions.textField").equals("textField"));
    Assert.assertTrue(Fixture.getCurrentPage() instanceof PageForActions);
}
Also used : Fixture(com.seleniumtests.core.runner.cucumber.Fixture) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Aggregations

GenericTest (com.seleniumtests.GenericTest)4 Fixture (com.seleniumtests.core.runner.cucumber.Fixture)4 Test (org.testng.annotations.Test)4 TestVariable (com.seleniumtests.core.TestVariable)1