Package net.thucydides.core.model

Examples of net.thucydides.core.model.TestStep


    }

    private Matcher<TestStep> hasNoScreenshot() {
        return new BaseMatcher<TestStep>() {
            public boolean matches(Object o) {
                TestStep step = (TestStep) o;
                return (step.getScreenshots()== null) || (step.getScreenshots().isEmpty());
            }

            public void describeTo(Description description) {
                description.appendText("with no screenshot");
            }
View Full Code Here


    }


    @Test
    public void the_result_of_a_step_group_with_no_children_should_be_the_group_default_result() {
        TestStep group = new TestStep("Test Group");
        group.setResult(TestResult.SUCCESS);

        assertThat(group.getResult(), is(TestResult.SUCCESS));

    }
View Full Code Here

    }

    @Test
    public void the_result_of_a_step_group_with_an_undefined_result_is_pending() {
        TestStep group = new TestStep("Test Group");
        group.addChildStep(new TestStep("Child step"));
        assertThat(group.getResult(), is(TestResult.PENDING));

    }
View Full Code Here

    }

    @Test
    public void the_result_of_a_step_group_with_children_should_be_the_result_of_the_children() {
        TestStep group = new TestStep("Test Group");

        group.setResult(TestResult.SUCCESS);


        TestStep testStep = new TestStep();
        testStep.setResult(TestResult.FAILURE);
        group.addChildStep(testStep);

        assertThat(group.getResult(), is(TestResult.FAILURE));

    }
View Full Code Here

        steps.step2();
        StepEventBus.getEventBus().testFinished(testOutcome);

        List<TestOutcome> results = stepListener.getTestOutcomes();
        TestOutcome testOutcome = results.get(0);
        TestStep firstStep = testOutcome.getTestSteps().get(0).getChildren().get(0);
        ScreenshotAndHtmlSource screenshot = firstStep.getScreenshots().get(0);
        assertThat(screenshot.getHtmlSource().isPresent(), is(false));
    }
View Full Code Here

        List<TestOutcome> executedScenarios = runner.getTestOutcomes();
        assertThat(executedScenarios.size(), is(2));
        TestOutcome testOutcome = executedScenarios.get(0);
        TestOutcome failingTestOutcome = executedScenarios.get(1);
        TestStep succeeds = testOutcome.getTestSteps().get(0);
        TestStep ignored = testOutcome.getTestSteps().get(1);
        TestStep pending = testOutcome.getTestSteps().get(2);
        TestStep failed = failingTestOutcome.getTestSteps().get(0);
        TestStep skipped = failingTestOutcome.getTestSteps().get(1);

        assertThat(succeeds.getResult(), is(TestResult.SUCCESS));
        assertThat(ignored.getResult(), is(TestResult.IGNORED));
        assertThat(pending.getResult(), is(TestResult.PENDING));
        assertThat(failed.getResult(), is(TestResult.FAILURE));
        assertThat(skipped.getResult(), is(TestResult.SKIPPED));
    }
View Full Code Here

        runner.run(new RunNotifier());

        List<TestOutcome> executedScenarios = runner.getTestOutcomes();

        TestOutcome testOutcome = executedScenarios.get(0);
        TestStep firstStep = testOutcome.getTestSteps().get(0);

        assertThat(firstStep.getDescription(), containsString("Step with a parameter:"));
        assertThat(firstStep.getDescription(), containsString("proportionOf"));
    }
View Full Code Here

        runner.run(new RunNotifier());

        List<TestOutcome> executedScenarios = runner.getTestOutcomes();

        TestOutcome testOutcome = executedScenarios.get(0);
        TestStep secondStep = testOutcome.getTestSteps().get(1);

        assertThat(secondStep.getDescription(), containsString("Step with two parameters"));
        assertThat(secondStep.getDescription(), containsString("proportionOf, 2"));
    }
View Full Code Here

TOP

Related Classes of net.thucydides.core.model.TestStep

Copyright © 2018 www.massapicom. 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.