Package net.thucydides.core.model

Examples of net.thucydides.core.model.TestOutcome$TitleBuilder


    }

    @Test
    public void spaces_in_the_qualifier_are_converted_to_underscores_for_the_report_name()  throws Exception {
        TestOutcome testOutcome = TestOutcome.forTest("should_do_this", SomeTestScenario.class);

        TestStep step1 = TestStepFactory.successfulTestStepCalled("step 1");
        File screenshot = temporaryDirectory.newFile("google_page_1.png");
        File screenshotSource = temporaryDirectory.newFile("google_page_1.html");
        step1.addScreenshot(new ScreenshotAndHtmlSource(screenshot,screenshotSource));
        testOutcome.recordStep(step1);

        reporter.setQualifier("a b c");

        File xmlReport = reporter.generateReportFor(testOutcome, allTestOutcomes);
        assertThat(xmlReport.getName(), is(Digest.ofTextValue("net.thucydides.core.reports.integration.AbstractReportGenerationTest/a_user_story_should_do_this_a_b_c") + ".html"));
View Full Code Here



    @Test
    public void the_resources_can_come_from_a_different_location_in_a_jar_file() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 1"));

        final String alternativeResourceDirectory = "alt-report-resources";
        reporter.setResourceDirectory(alternativeResourceDirectory);
        reporter.generateReportFor(testOutcome, allTestOutcomes);
       
View Full Code Here

    }

    @Test
    public void the_resources_can_come_from_the_current_project() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 1"));

        final String alternativeResourceDirectory = "localresourcelist";
        reporter.setResourceDirectory(alternativeResourceDirectory);
        reporter.generateReportFor(testOutcome, allTestOutcomes);
View Full Code Here

    }

    @Test
    public void a_different_resource_location_can_be_specified_by_using_a_system_property() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 1"));

        environmentVariables.setProperty("thucydides.report.resources", "alt-report-resources");
        reporter.generateReportFor(testOutcome, allTestOutcomes);
       
        File expectedCssStylesheet = new File(new File(outputDirectory,"css"), "alternative.css");
View Full Code Here

    }

    @Test
    public void when_an_alternative_resource_directory_is_used_the_default_stylesheet_is_not_copied() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 1"));

        final String alternativeResourceDirectory = "alt-report-resources";
        reporter.setResourceDirectory(alternativeResourceDirectory);
        reporter.generateReportFor(testOutcome, allTestOutcomes);
       
View Full Code Here

   

    @Test
    public void the_report_should_list_test_groups_as_headings_in_the_table() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");

        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 0"));
        testOutcome.startGroup("A group");
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 1"));
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 2"));
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 3"));
        testOutcome.startGroup("Another group");
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 4"));
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 5"));
        testOutcome.startGroup("Yet another group");
        testOutcome.recordStep(forAnIgnoredTestStepCalled("Step 6"));
        testOutcome.endGroup();
        testOutcome.recordStep(forABrokenTestStepCalled("Step 7", new AssertionError("Oh bother!")));
        testOutcome.recordStep(forABrokenTestStepCalled("Step 8", new AssertionError("Oh bother!")));
        testOutcome.recordStep(forASkippedTestStepCalled("Step 9"));
        testOutcome.recordStep(forAPendingTestStepCalled("Step 10"));
        testOutcome.recordStep(forAPendingTestStepCalled("Step 11"));
        testOutcome.recordStep(forAPendingTestStepCalled("Step 12"));
        testOutcome.endGroup();
        testOutcome.recordStep(forAPendingTestStepCalled("Step 13"));
        testOutcome.recordStep(forAPendingTestStepCalled("Step 14"));
        testOutcome.endGroup();
        testOutcome.recordStep(forASkippedTestStepCalled("Step 15"));

        reporter.setOutputDirectory(new File("target/thucyidides"));
        reporter.generateReportFor(testOutcome, allTestOutcomes);
    }
View Full Code Here

    }
   
    @Test
    public void a_sample_report_should_be_generated_in_the_target_directory() throws Exception {

        TestOutcome testOutcome = new TestOutcome("a_simple_test_case");
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 1"));
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 2"));
        testOutcome.recordStep(TestStepFactory.successfulTestStepCalled("step 3"));
        testOutcome.recordStep(TestStepFactory.failingTestStepCalled("step 4"));
        testOutcome.recordStep(TestStepFactory.skippedTestStepCalled("step 5"));
        testOutcome.recordStep(TestStepFactory.pendingTestStepCalled("step 6"));

        reporter.setOutputDirectory(new File("target/thucyidides"));
        reporter.generateReportFor(testOutcome, allTestOutcomes);
    }
View Full Code Here

        issueTracking = new SystemPropertiesIssueTracking(environmentVariables);
    }

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

        recordSimpleTest(testOutcome);
View Full Code Here

    }


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

        recordSimpleTest(testOutcome);
View Full Code Here

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

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

        recordSimpleTest(testOutcome);
View Full Code Here

TOP

Related Classes of net.thucydides.core.model.TestOutcome$TitleBuilder

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.