Examples of Scenario


Examples of org.jbehave.core.model.Scenario

    }

    @Test
    public void shouldRunAfterAndBeforeScenarioSteps() throws Throwable{
        // Given
        Scenario scenario1 = new Scenario("my title 1", Meta.EMPTY, GivenStories.EMPTY, ExamplesTable.EMPTY, asList("step"));
        Story story = new Story(new Description("my blurb"), Narrative.EMPTY, asList(scenario1));
        StoryReporter reporter = mock(ConcurrentStoryReporter.class);
        StepCollector collector = mock(StepCollector.class);
        FailureStrategy failureStrategy = mock(FailureStrategy.class);
        Configuration configuration = configurationWith(reporter, collector, failureStrategy);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

    }

    @Test
    public void shouldRunStepsInDryRunMode() 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));
        Step step = mock(Step.class);
        StepResult result = mock(StepResult.class, "result");
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        FailureStrategy strategy = mock(FailureStrategy.class);
        CandidateSteps mySteps = new Steps();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
                Arrays.<Step>asList());
        Meta meta = new Meta(asList("some property"));
        Story story = new Story("", Description.EMPTY, meta, Narrative.EMPTY, asList(new Scenario()));
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story, givenStory, collector, mySteps);
        String filterAsString = "-some property";
        MetaFilter filter = new MetaFilter(filterAsString);
       
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        assertThat(beforeSteps.get(0), equalTo("Given a step before each scenario"));
        assertThat(beforeSteps.get(1), equalTo("And another before step"));
        List<String> afterSteps = story.getLifecycle().getAfterSteps();
        assertThat(afterSteps.get(0), equalTo("Given a step after each scenario"));
        assertThat(afterSteps.get(1), equalTo("And another after step"));
        Scenario scenario = story.getScenarios().get(0);
        List<String> steps = scenario.getSteps();
        assertThat(steps.get(0), equalTo("Given a scenario"));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        StepCollector collector = mock(StepCollector.class);
        FailureStrategy strategy = mock(FailureStrategy.class);
        CandidateSteps mySteps = new Steps();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
                Arrays.<Step>asList());
        Story story = new Story("excluded_path", Description.EMPTY, Meta.EMPTY, Narrative.EMPTY, asList(new Scenario()));
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story, givenStory, collector, mySteps);
        String filterAsString = "-story_path excluded_path";
        MetaFilter filter = new MetaFilter(filterAsString);
       
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        FailureStrategy strategy = mock(FailureStrategy.class);
        CandidateSteps mySteps = new Steps();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
                Arrays.<Step>asList());
        Meta meta = new Meta(asList("some property"));
        Story story = new Story("", Description.EMPTY, Meta.EMPTY, Narrative.EMPTY, asList(new Scenario("", meta, GivenStories.EMPTY, ExamplesTable.EMPTY, asList(""))));
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story, givenStory, collector, mySteps);
        String filterAsString = "-some property";
        MetaFilter filter = new MetaFilter(filterAsString);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        List<String> beforeSteps = story.getLifecycle().getBeforeSteps();
        assertThat(beforeSteps.get(0), equalTo("Given a step before each scenario"));
        assertThat(beforeSteps.get(1), equalTo("And another before step"));
        List<String> afterSteps = story.getLifecycle().getAfterSteps();
        assertThat(afterSteps.isEmpty(), equalTo(true));
        Scenario scenario = story.getScenarios().get(0);
        List<String> steps = scenario.getSteps();
        assertThat(steps.get(0), equalTo("Given a scenario"));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        StepCollector collector = mock(StepCollector.class);
        FailureStrategy strategy = mock(FailureStrategy.class);
        CandidateSteps mySteps = new Steps();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), (Scenario) anyObject(), eq(parameters))).thenReturn(
                Arrays.<Step>asList());
        Story story = new Story("", Description.EMPTY, Meta.EMPTY, Narrative.EMPTY, asList(new Scenario("excluded_title", Meta.EMPTY, GivenStories.EMPTY, ExamplesTable.EMPTY, asList(""))));
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story, givenStory, collector, mySteps);
        String filterAsString = "-scenario_title excluded_title";
        MetaFilter filter = new MetaFilter(filterAsString);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        List<String> beforeSteps = story.getLifecycle().getBeforeSteps();
        assertThat(beforeSteps.isEmpty(), equalTo(true));
        List<String> afterSteps = story.getLifecycle().getAfterSteps();
        assertThat(afterSteps.get(0), equalTo("Given a step after each scenario"));
        assertThat(afterSteps.get(1), equalTo("And another after step"));
        Scenario scenario = story.getScenarios().get(0);
        List<String> steps = scenario.getSteps();
        assertThat(steps.get(0), equalTo("Given a scenario"));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        assertThat(lifecycle.getAfterSteps(Outcome.ANY).get(0), equalTo("Given a step after any scenario"));
        assertThat(lifecycle.getAfterSteps(Outcome.SUCCESS).size(), equalTo(1));
        assertThat(lifecycle.getAfterSteps(Outcome.SUCCESS).get(0), equalTo("Given a step after successful scenario"));
        assertThat(lifecycle.getAfterSteps(Outcome.FAILURE).size(), equalTo(1));
        assertThat(lifecycle.getAfterSteps(Outcome.FAILURE).get(0), equalTo("Given a step after failed scenario"));
        Scenario scenario = story.getScenarios().get(0);
        List<String> steps = scenario.getSteps();
        assertThat(steps.get(0), equalTo("Given a scenario"));
    }
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.