Examples of TestOutcome


Examples of net.thucydides.core.model.TestOutcome

        assertThat(reportContents, containsString("<a target=\"_blank\" href=\"http://my.jira/browse/1234\">#1234</a>"));
    }

    @Test
    public void the_jira_project_name_should_be_included_in_the_jira_links_if_defined()  throws Exception {
        TestOutcome testOutcome = TestOutcome.forTest("a_simple_test_case", JIRAAnnotatedTestScenario.class)
                                              .usingIssueTracking(issueTracking);
        environmentVariables.setProperty("jira.url", "http://my.jira");
        environmentVariables.setProperty("jira.project", "MYPROJECT");

        recordSimpleTest(testOutcome);
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        assertThat(reportContents, containsString("<a target=\"_blank\" href=\"http://my.jira/browse/MYPROJECT-1234\">#1234</a>"));
    }

    @Test
    public void jira_issue_numbers_should_be_converted_to_URLs_when_a_jira_base_url_is_provided()  throws Exception {
        TestOutcome testOutcome = TestOutcome.forTest("should_do_this_too", JIRAAnnotatedTestScenario.class)
                                              .usingIssueTracking(issueTracking);
        environmentVariables.setProperty("thucydides.issue.tracker.url", "http://my.issue.tracker/{0}");

        recordSimpleTest(testOutcome);
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        List<TestCase> rawTestCases = testSuite.getTestCases();
        List<TestOutcome> groupedTestOutcomes = Lists.newArrayList();
        Map<String, TestOutcome> testOutcomesIndex = Maps.newHashMap();

        for(TestCase testCase : rawTestCases) {
            TestOutcome testOutcome = testOutcomeForTestClass(testOutcomesIndex, testCase.getClassname());
            addIfNotPresent(groupedTestOutcomes, testOutcome);
            TestStep nextStep = TestStep.forStepCalled(testCase.getName()).withResult(resultOf(testCase));
            Optional<Throwable> testFailure = testFailureFrom(testCase);
            if (testFailure.isPresent()) {
                nextStep.failedWith(testFailure.get());
            }
            testOutcome.recordStep(nextStep);
        }
        return ImmutableList.copyOf(groupedTestOutcomes);
    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

    private TestOutcome testOutcomeForTestClass(Map<String, TestOutcome> groupedTestOutcomes, String testClassName) {
        if (groupedTestOutcomes.containsKey(testClassName)) {
            return groupedTestOutcomes.get(testClassName);
        }
        TestOutcome newTestOutcome = TestOutcome.forTestInStory(testClassName, Story.called(testClassName));
        groupedTestOutcomes.put(testClassName, newTestOutcome);
        return newTestOutcome;
    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

    private Converter<TestCase, TestOutcome> toTestOutcomes() {
        return new Converter<TestCase, TestOutcome>() {

            @Override
            public TestOutcome convert(TestCase from) {
                TestOutcome outcome = TestOutcome.forTestInStory(from.getName(), Story.called(from.getClassname()));
                outcome.setTitle(NameConverter.humanize(from.getName()));
                outcome.setDuration(timeAsLong(from.getTime()));

                if (from.getError().isPresent()) {
                    TestException failure = from.getError().get();
                    outcome.determineTestFailureCause(failure.asException());
                } else if (from.getFailure().isPresent()) {
                    TestException failure = from.getFailure().get();
                    outcome.determineTestFailureCause(failure.asAssertionFailure());
                } else if (from.getSkipped().isPresent()) {
                    //although it is logged by junit as 'skipped', Thucydides
                    //makes a distinction between skipped and ignored.
                    //outcome.setAnnotatedResult(TestResult.IGNORED);

                    //setting the outcome to PENDING for now as the reports don't yet handle the
                    //ignored test cases
                    outcome.setAnnotatedResult(TestResult.PENDING);
                } else {
                    outcome.setAnnotatedResult(TestResult.SUCCESS);
                }
                return outcome;
            }
        };
    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        runner.run(new RunNotifier());

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

        List<TestStep> dataDrivenSteps = testOutcome1.getTestSteps();
        assertThat(dataDrivenSteps.size(), is(12));

    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        runner.run(new RunNotifier());

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

        List<TestStep> dataDrivenSteps = testOutcome1.getTestSteps();
        assertThat(dataDrivenSteps.size(), is(12));

    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        runner.run(new RunNotifier());

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

        List<TestStep> dataDrivenSteps = testOutcome1.getTestSteps();
        assertThat(dataDrivenSteps.size(), is(12));
        assertThat(dataDrivenSteps.get(1).getResult(), is(TestResult.FAILURE));
        assertThat(dataDrivenSteps.get(2).getResult(), is(TestResult.SUCCESS));

    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        runner.run(new RunNotifier());

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

        List<TestStep> dataDrivenSteps = testOutcome1.getTestSteps();
        assertThat(dataDrivenSteps.size(), is(12));
        assertThat(dataDrivenSteps.get(1).getResult(), is(TestResult.ERROR));
        assertThat(dataDrivenSteps.get(2).getResult(), is(TestResult.SUCCESS));
    }
View Full Code Here

Examples of net.thucydides.core.model.TestOutcome

        runner.run(new RunNotifier());

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

        List<TestStep> dataDrivenSteps = testOutcome1.getTestSteps();
        assertThat(dataDrivenSteps.size(), is(12));

    }
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.