use of gherkin.pickles.PickleLocation in project seleniumRobot by bhecquet.
the class TestCucumberScenarioWrapper method testScenarioToStringShortPlaceholder.
/**
* With placeholder on scenario outline, we use the pickle name as placeholders have been replaced
* @param testNGCtx
*/
@Test(groups = { "ut" })
public void testScenarioToStringShortPlaceholder(ITestContext testNGCtx) {
when(cucumberScenarioWithExample.getName()).thenReturn("short <foo>");
Pickle pickle2 = new Pickle("short foobar", "en", new ArrayList<>(), new ArrayList<>(), // location for scenario outline
Arrays.asList(// location for scenario outline
new PickleLocation(2, 2), new PickleLocation(6, 5)));
PickleEvent pickleEvent2 = new PickleEvent("uri", pickle2);
Assert.assertEquals(new CucumberScenarioWrapper(pickleEvent2, cucumberScenarioWithExample).toString(150), "short foobar");
}
use of gherkin.pickles.PickleLocation in project seleniumRobot by bhecquet.
the class TestCucumberScenarioWrapper method testScenarioToStringShortNoPlaceholder.
/**
* Without placeholder on scenario outline, we use the scenario outline description plus example value
* @param testNGCtx
*/
@Test(groups = { "ut" })
public void testScenarioToStringShortNoPlaceholder(ITestContext testNGCtx) {
when(cucumberScenarioWithExample.getName()).thenReturn("short");
Pickle pickle2 = new Pickle("short", "en", new ArrayList<>(), new ArrayList<>(), // location for scenario outline
Arrays.asList(// location for scenario outline
new PickleLocation(2, 2), // location for example
new PickleLocation(6, 5)));
PickleEvent pickleEvent2 = new PickleEvent("uri", pickle2);
Assert.assertEquals(new CucumberScenarioWrapper(pickleEvent2, cucumberScenarioWithExample).toString(-1), "short-| bar | bar2 |");
}
Aggregations