Package net.thucydides.junit.runners

Examples of net.thucydides.junit.runners.ThucydidesRunner


    public class ScenarioThread extends Thread {

        ThucydidesRunner runner;

        public ScenarioThread()  throws InitializationError {
            runner = new ThucydidesRunner(SamplePassingScenarioUsingHtmlUnit.class);
        }
View Full Code Here


    public DisableThucydidesHistoryRule disableThucydidesHistoryRule = new DisableThucydidesHistoryRule();

    @Test
    public void the_test_runner_records_the_steps_as_they_are_executed() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(LongSamplePassingScenarioUsingPhantomJS.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(1));
        TestOutcome testOutcome1 = executedSteps.get(0);

        assertThat(testOutcome1.getTitle(), is("Happy day scenario"));
        assertThat(testOutcome1.getMethodName(), is("happy_day_scenario"));
View Full Code Here

    static List<Integer> executedTests = new CopyOnWriteArrayList<Integer>();
    static AtomicInteger testCount = new AtomicInteger(0);

    private void runTestCases(SystemVariableBasedBatchManager batchManager) {
        try {
            new ThucydidesRunner(SampleTestScenario1.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario2.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario3.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario4.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario5.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario6.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario7.class, batchManager).run(new RunNotifier());
            new ThucydidesRunner(SampleTestScenario8.class, batchManager).run(new RunNotifier());
        } catch (InitializationError initializationError) {
            initializationError.printStackTrace();
        }
    }
View Full Code Here

    }

    @Test
    public void result_is_a_pass_despite_initial_failure() throws Exception {
        environmentVariables.setProperty(MAX_RETRIES, "5");
        ThucydidesRunner runner = new ThucydidesRunner(FailThenPassSample.class,
                                                       new WebDriverFactory(environmentVariables),
                                                       new SystemPropertiesConfiguration(environmentVariables));

        CapturingNotifier notifier = new CapturingNotifier();
        runner.run(notifier);
        List<TestOutcome> outcomes = runner.getTestOutcomes();

        assertThat(outcomes.size(), is(1));
        assertThat(outcomes.get(0).getResult(), is(TestResult.SUCCESS));
        assertThat(notifier.failed, is(false));
    }
View Full Code Here

    public DisableThucydidesHistoryRule disableThucydidesHistoryRule = new DisableThucydidesHistoryRule();

    @Test
    public void the_test_runner_records_the_steps_as_they_are_executed() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SampleNonWebScenarioWithError.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedScenarios = runner.getTestOutcomes();
        assertThat(executedScenarios.size(), is(3));
    }
View Full Code Here

    }

    @Test
    public void the_test_runner_records_the_steps_as_they_are_executed() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SamplePassingNonWebScenario.class, injector);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(3));

        assertThat(inTheTesOutcomes(executedSteps).theOutcomeFor("happy_day_scenario").getTitle(), is("Happy day scenario"));
        assertThat(inTheTesOutcomes(executedSteps).theOutcomeFor("edge_case_1").getTitle(), is("Edge case 1"));
        assertThat(inTheTesOutcomes(executedSteps).theOutcomeFor("edge_case_2").getTitle(), is("Edge case 2"));
View Full Code Here


    @Test
    public void tests_marked_as_pending_should_be_pending() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SamplePassingNonWebScenarioWithPendingTests.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(3));

        assertThat(inTheTesOutcomes(executedSteps).theResultFor("happy_day_scenario"), is(TestResult.SUCCESS));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_1"), is(TestResult.PENDING));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_2"), is(TestResult.PENDING));
View Full Code Here

    }

    @Test
    public void tests_marked_as_ignored_should_be_skipped() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SamplePassingNonWebScenarioWithIgnoredTests.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(3));

        assertThat(inTheTesOutcomes(executedSteps).theResultFor("happy_day_scenario"), is(TestResult.SUCCESS));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_1"), is(TestResult.IGNORED));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_2"), is(TestResult.IGNORED));
View Full Code Here

    }

    @Test
    public void tests_with_no_steps_should_be_marked_as_successful() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SamplePassingNonWebScenarioWithEmptyTests.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(3));

        assertThat(inTheTesOutcomes(executedSteps).theResultFor("happy_day_scenario"), is(TestResult.SUCCESS));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_1"), is(TestResult.SUCCESS));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_2"), is(TestResult.PENDING));
View Full Code Here


    @Test
    public void tests_should_be_run_after_an_assertion_error() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SampleNonWebScenarioWithError.class);
        runner.run(new RunNotifier());

        List<TestOutcome> executedSteps = runner.getTestOutcomes();
        assertThat(executedSteps.size(), is(3));

        assertThat(inTheTesOutcomes(executedSteps).theResultFor("happy_day_scenario"), is(TestResult.FAILURE));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_1"), is(TestResult.SUCCESS));
        assertThat(inTheTesOutcomes(executedSteps).theResultFor("edge_case_2"), is(TestResult.SUCCESS));
View Full Code Here

TOP

Related Classes of net.thucydides.junit.runners.ThucydidesRunner

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.