Package net.thucydides.core.screenshots

Examples of net.thucydides.core.screenshots.ScreenshotAndHtmlSource


        TestOutcome testOutcome = TestOutcome.forTest("a_simple_test_case", SomeTestScenario.class);

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

        reporter.setQualifier("qualifier");

        File xmlReport = reporter.generateReportFor(testOutcome, allTestOutcomes);
View Full Code Here


        File screenshot = temporaryFolder.newFile("screenshot.png");
        File source = temporaryFolder.newFile("screenshot.html");

        assertThat(step.hasScreenshots(), is(false));

        step.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));

        assertThat(step.hasScreenshots(), is(true));
        assertThat(step.getScreenshots().get(0).getScreenshotFile(), is(screenshot));
        assertThat(step.getScreenshots().get(0).getHtmlSource().get(), is(source));
    }
View Full Code Here

        TestStep step = new TestStep("a narrative description");

        step.addScreenshot(forScreenshotWithImage("/screenshots/google_page_1.png").and().withSource("screenshot.html"));
        step.addScreenshot(forScreenshotWithImage("/screenshots/google_page_2.png").and().withSource("screenshot2.html"));

        ScreenshotAndHtmlSource screenshot1 = step.getScreenshots().get(0);
        ScreenshotAndHtmlSource screenshot2 = step.getScreenshots().get(1);

        assertThat(screenshot1.getScreenshotFile().getName(), is("google_page_1.png"));
        assertThat(screenshot1.getHtmlSource().get().getName(), is("screenshot.html"));

        assertThat(screenshot2.getScreenshotFile().getName(), is("google_page_2.png"));
        assertThat(screenshot2.getHtmlSource().get().getName(), is("screenshot2.html"));
       
        assertThat(screenshot1.hashCode(), is(not(screenshot2.hashCode())));
    }
View Full Code Here

    public void the_first_screenshot_can_be_used_to_represent_the_step() throws IOException {
        TestStep step = new TestStep("a narrative description");

        File screenshot = temporaryFolder.newFile("screenshot.png");
        File source = temporaryFolder.newFile("screenshot.html");
        step.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));

        File screenshot2 = temporaryFolder.newFile("screenshot2.png");
        File source2 = temporaryFolder.newFile("screenshot2.html");
        step.addScreenshot(new ScreenshotAndHtmlSource(screenshot2, source2));

        assertThat(step.getFirstScreenshot().getScreenshotFile(), is(screenshot));
        assertThat(step.getFirstScreenshot().getHtmlSource().get(), is(source));
    }
View Full Code Here

    public void if_a_screenshot_is_identical_to_the_previous_one_in_the_step_it_wont_be_added() throws IOException {
        TestStep step = new TestStep("a narrative description");

        File screenshot = temporaryFolder.newFile("screenshot.png");
        File source = temporaryFolder.newFile("screenshot.html");
        step.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));
        step.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));

        assertThat(step.getScreenshots().size(), is(1));
    }
View Full Code Here

        }
       
        public ScreenshotAndHtmlSource withSource(String source) throws IOException {
            File screenshotFile = screenshotFileFrom(image);
            File sourceFile = new File(source);
            return new ScreenshotAndHtmlSource(screenshotFile, sourceFile);
        }
View Full Code Here

        return step;
    }

    public static TestStep createNewTestStep(String description, TestResult result) {
        TestStep step = new TestStep(description);
        step.addScreenshot(new ScreenshotAndHtmlSource(new File(description + ".png"), new File(description + ".html")));
        step.setResult(result);
        step.setDuration(100);
        return step;

    }
View Full Code Here

    public static TestStep createNewNestedTestSteps(String description, TestResult result) {
        TestStep step =  new TestStep(description);
        TestStep child1 = new TestStep(description);
        TestStep child2 = new TestStep(description);

        child1.addScreenshot(new ScreenshotAndHtmlSource(new File(description + ".png"), new File(description + ".html")));
        child1.setResult(result);
        child1.setDuration(100);

        child2.addScreenshot(new ScreenshotAndHtmlSource(new File(description + ".png"), new File(description + ".html")));
        child2.setResult(result);
        child2.setDuration(100);

        step.addChildStep(child1);
        step.addChildStep(child2);
View Full Code Here

TOP

Related Classes of net.thucydides.core.screenshots.ScreenshotAndHtmlSource

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.