use of io.cucumber.plugin.event.Step in project cucumber-jvm by cucumber.
the class PickleRunnerWithStepDescriptionsTest method shouldAssignUnequalDescriptionsToDifferentOccurrencesOfSameStepInAScenario.
@Test
void shouldAssignUnequalDescriptionsToDifferentOccurrencesOfSameStepInAScenario() {
List<Pickle> pickles = picklesFromFeature("path/test.feature", "" + "Feature: FB\n" + "# Scenario with same step occurring twice\n" + "\n" + " Scenario: SB\n" + " When foo\n" + " Then bar\n" + "\n" + " When foo\n" + " Then baz\n");
WithStepDescriptions runner = (WithStepDescriptions) PickleRunners.withStepDescriptions(context, pickles.get(0), null, createJunitOptions());
// fish out the two occurrences of the same step and check whether we
// really got them
Step stepOccurrence1 = runner.getChildren().get(0);
Step stepOccurrence2 = runner.getChildren().get(2);
assertEquals(stepOccurrence1.getText(), stepOccurrence2.getText());
// then check that the descriptions are unequal
Description runnerDescription = runner.getDescription();
Description stepDescription1 = runnerDescription.getChildren().get(0);
Description stepDescription2 = runnerDescription.getChildren().get(2);
assertNotEquals(stepDescription1, stepDescription2);
}
use of io.cucumber.plugin.event.Step in project cucumber-jvm by cucumber.
the class TestCaseResultObserverTest method createPickleStepTestStep.
private PickleStepTestStep createPickleStepTestStep() {
PickleStepTestStep testStep = mock(PickleStepTestStep.class);
Step step = mock(Step.class);
when(step.getLocation()).thenReturn(location);
when(testStep.getStep()).thenReturn(step);
when(testStep.getUri()).thenReturn(uri);
return testStep;
}
Aggregations