Examples of Scenario


Examples of org.jbehave.core.model.Scenario

          + "| 4 | true |";
    Story story = storyParser.parseStory(storyAsText);   
    assertThat(story.getDescription().asString(), equalTo("Hello Car"));   
    List<Scenario> scenarios = story.getScenarios();
    assertThat(scenarios.size(), equalTo(1));
    Scenario scenario = scenarios.get(0);
    List<String> steps = scenario.getSteps();
    assertThat(scenario.getTitle(), equalTo("Car can drive"));   
    assertThat(scenario.getMeta().hasProperty("scenarioOutline"), is(true));
    assertThat(steps.size(), equalTo(3));
    assertThat(steps.get(0), equalTo("Given I have a car"));
    assertThat(steps.get(1), equalTo("When I add <wheels>"));
    assertThat(steps.get(2), equalTo("Then It <can_drive>"));
    assertThat(scenario.getExamplesTable().asString(), equalTo(
          "|wheels|can_drive|\n"
        + "|1|false|\n"
        + "|2|false|\n"
        + "|3|false|\n"
        + "|4|true|\n"));
View Full Code Here

Examples of org.jbehave.core.model.Scenario

                    + "Given I have a car with 4 wheels\n"
                    + "Then I can drive it.\n";
        Story story = storyParser.parseStory(storyAsText);
        assertThat(story.getDescription().asString(), equalTo("Hello Car"));
        assertThat(story.getMeta().hasProperty("feature"), is(true));       
        Scenario scenario = story.getScenarios().get(0);
        assertThat(scenario.getSteps().size(), equalTo(2));
        assertThat(scenario.getMeta().hasProperty("scenario"), is(true));       
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        GivenStories givenStories = new GivenStories(StringUtils.join(givenStoryPaths, ","));
        ExamplesTable examplesTable = new ExamplesTable("|one|two|\n|1|2|\n");
        UUIDExceptionWrapper anException = new UUIDExceptionWrapper(new IllegalArgumentException());
        Story story = new Story();
        boolean givenStory = false;
        Scenario scenario = new Scenario();
        String filter = "-some property";
       
        // When
        delegator.dryRun();
       
View Full Code Here

Examples of org.jbehave.core.model.Scenario

    }

    @Test
    public void shouldRunStepsInStoryAndReportResultsToReporter() throws Throwable {
        // Given
        Scenario scenario1 = new Scenario("my title 1", asList("failingStep",
                "successfulStep"));
        Scenario scenario2 = new Scenario("my title 2", asList("successfulStep"));
        Scenario scenario3 = new Scenario("my title 3", asList("successfulStep",
                "pendingStep"));
        Story story = new Story(new Description("my blurb"), Narrative.EMPTY, asList(scenario1,
                scenario2, scenario3));
        StoryReporter reporter = mock(ConcurrentStoryReporter.class);
        StepCollector collector = mock(StepCollector.class);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

    @Test
    public void shouldRunGivenStoriesAtStoryAndScenarioLevel() throws Throwable {
        // Given
        GivenStories storyGivenStories = new GivenStories("/path/to/given/story1");
        GivenStories scenarioGivenStories = new GivenStories("/path/to/given/story1");
        Scenario scenario1 = new Scenario("scenario 1", asList("successfulStep"));
        Scenario scenario2 = new Scenario("scenario 2", Meta.EMPTY, scenarioGivenStories, ExamplesTable.EMPTY,
                asList("anotherSuccessfulStep"));
        Story story1 = new Story(new Description("story 1"), Narrative.EMPTY, asList(scenario1));
        Story story2 = new Story("", new Description("story 2"), Meta.EMPTY, Narrative.EMPTY, storyGivenStories, asList(scenario2));

        Step step = mock(Step.class);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

   
    @Test
  public void shouldIgnoreMetaFilteringInGivenStoriesIfConfigured()
      throws Throwable {
    // Given
    Scenario scenario = new Scenario("scenario", new Meta(
        asList("run false")), new GivenStories("/path/to/given/story"),
        ExamplesTable.EMPTY, asList("anotherSuccessfulStep"));
    Story story = new Story("", new Description("story"), new Meta(
        asList("run false")), Narrative.EMPTY, new GivenStories(
        "/path/to/given/story"), asList(scenario));
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        Step secondStepPending = mock(Step.class, "secondStepPending");
        Step thirdStepNormal = mock(Step.class, "thirdStepNormal");
        Step fourthStepAlsoPending = mock(Step.class, "fourthStepAlsoPending");
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        Scenario scenario = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario), eq(parameters))).thenReturn(
                asList(firstStepNormal, secondStepPending, thirdStepNormal, fourthStepAlsoPending));
        when(secondStepPending.perform(null)).thenReturn(pending("When I am pending"));
        when(thirdStepNormal.doNotPerform(Matchers.<UUIDExceptionWrapper>any())).thenReturn(notPerformed("Then I should not be performed"));
        when(fourthStepAlsoPending.doNotPerform(Matchers.<UUIDExceptionWrapper>any())).thenReturn(
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        Step lastStepNormal = mockSuccessfulStep("Then I succeeded");

        StepCollector collector = mock(StepCollector.class);
        FailureStrategy strategy = mock(FailureStrategy.class);
        CandidateSteps mySteps = new Steps();
        Scenario scenario = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario), eq(parameters))).thenReturn(
                asList(firstStepNormal, restartStep, lastStepNormal));
        Story story = new Story(asList(scenario));
        givenStoryWithNoBeforeOrAfterSteps(story, false, collector, mySteps);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        when(firstStepExceptional.perform(null)).thenReturn(failed);
        when(secondStepNotPerformed.doNotPerform(Matchers.<UUIDExceptionWrapper>any())).thenReturn(notPerformed);
        FailureStrategy failureStrategy = mock(FailureStrategy.class);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        Scenario scenario = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario), eq(parameters))).thenReturn(
                asList(firstStepExceptional, secondStepNotPerformed));
        Story story = new Story(asList(scenario));
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story, givenStory, collector, mySteps);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        StepResult failed = failed("When I fail", new UUIDExceptionWrapper(new IllegalStateException()));
        when(failedStep.perform(null)).thenReturn(failed);
        FailureStrategy failureStrategy = mock(FailureStrategy.class);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        Scenario scenario1 = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario1), eq(parameters))).thenReturn(
                asList(failedStep));
        Scenario scenario2 = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario2), eq(parameters))).thenReturn(
                asList(neverExecutedStep));
        Story story = new Story(asList(scenario1, scenario2));
        givenStoryWithNoBeforeOrAfterSteps(story, false, collector, mySteps);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.