Examples of FlatScenarioSteps


Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    @Test
    public void the_listener_should_record_basic_step_execution() {

        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished();

        List<TestOutcome> results = stepListener.getTestOutcomes();
        assertThat(results.size(), is(1));
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    @Test
    public void the_listener_should_record_given_when_then_step_execution() {

        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.given_some_state();
        steps.when_we_do_something();
        steps.then_this_should_happen();

        StepEventBus.getEventBus().testFinished();

        List<TestOutcome> results = stepListener.getTestOutcomes();
        assertThat(results.size(), is(1));
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    @Test
    public void the_listener_should_record_issue_tags() {

        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().addIssuesToCurrentTest(Lists.newArrayList("issue-123","issue-456"));
        StepEventBus.getEventBus().testFinished();

        List<TestOutcome> results = stepListener.getTestOutcomes();
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    }

    @Test
    public void the_listener_should_record_issue_tags_for_multiple_scenarios_in_a_story() {

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        StepEventBus.getEventBus().testSuiteStarted(MyTestCase.class);
        StepEventBus.getEventBus().addIssuesToCurrentStory(Lists.newArrayList("issue-123"));

        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);
        StepEventBus.getEventBus().addIssuesToCurrentTest(Lists.newArrayList("issue-456"));
        StepEventBus.getEventBus().addTagsToCurrentStory(Lists.newArrayList(TestTag.withName("iteration-1").andType("iteration")));
        StepEventBus.getEventBus().addTagsToCurrentTest(Lists.newArrayList(TestTag.withName("fast").andType("speed")));

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished();

        StepEventBus.getEventBus().testStarted("app_should_work_again", MyTestCase.class);
        StepEventBus.getEventBus().addIssuesToCurrentTest(Lists.newArrayList("issue-789"));

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished();
        StepEventBus.getEventBus().testSuiteFinished();

        List<TestOutcome> results = stepListener.getTestOutcomes();
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    }

    @Test
    public void the_listener_should_be_able_to_update_step_names() {

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        StepEventBus.getEventBus().testSuiteStarted(MyTestCase.class);
        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);
        steps.step_one();
        steps.step_two();
        StepEventBus.getEventBus().updateCurrentStepTitle("new_step_name");
        StepEventBus.getEventBus().testFinished();
        StepEventBus.getEventBus().testSuiteFinished();

        List<TestOutcome> results = stepListener.getTestOutcomes();
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    public void the_listener_should_record_the_tested_story() {

        StepEventBus.getEventBus().testSuiteStarted(MyTestCase.class);
        StepEventBus.getEventBus().testStarted("app_should_work", MyTestCase.class);

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        assertThat(outcome.getUserStory().getName(), is("My story"));
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    public void if_no_user_story_is_specified_the_test_case_name_should_be_used_instead() {

        StepEventBus.getEventBus().testSuiteStarted(MyTestCaseWithoutAStory.class);
        StepEventBus.getEventBus().testStarted("app_should_work");

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        assertThat(outcome.getUserStory().getName(), is("My test case without a story"));
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    @Test
    public void you_can_also_specify_the_story_class_directly() {
        StepEventBus.getEventBus().testSuiteStarted(MyStory.class);
        StepEventBus.getEventBus().testStarted("app_should_work");

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);

        steps.step_one();
        steps.step_two();

        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        net.thucydides.core.model.Story story = outcome.getUserStory();
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    public void the_test_result_should_record_the_tested_feature() {

        StepEventBus.getEventBus().testSuiteStarted(MyTestCaseForAFeature.class);
        StepEventBus.getEventBus().testStarted("app_should_work");

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);
        steps.step_one();
        steps.step_two();
        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        ApplicationFeature feature = outcome.getFeature();
        assertThat(feature.getId(), is(MyFeature.class.getCanonicalName()));
View Full Code Here

Examples of net.thucydides.core.steps.samples.FlatScenarioSteps

    public void the_name_of_the_tested_feature_should_match_the_feature_class() {

        StepEventBus.getEventBus().testSuiteStarted(MyTestCaseForAFeature.class);
        StepEventBus.getEventBus().testStarted("app_should_work");

        FlatScenarioSteps steps = stepFactory.getStepLibraryFor(FlatScenarioSteps.class);
        steps.step_one();
        steps.step_two();
        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        ApplicationFeature feature = outcome.getFeature();
        assertThat(feature.getName(), is("My feature"));
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.