Package net.thucydides.core.screenshots

Examples of net.thucydides.core.screenshots.ScreenshotAndHtmlSource


                String childNode = reader.getNodeName();
                if (childNode.equals(SCREENSHOT_FIELD)) {
                    String screenshot = reader.getAttribute(SCREENSHOT_IMAGE);
                    String source = reader.getAttribute(SCREENSHOT_SOURCE);
                    if (source != null) {
                        step.addScreenshot(new ScreenshotAndHtmlSource(new File(screenshot), new File(source)));
                    } else {
                        step.addScreenshot(new ScreenshotAndHtmlSource(new File(screenshot)));
                    }
                }
                reader.moveUp();
            }
        }
View Full Code Here


        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.generateReportFor(testOutcome, allTestOutcomes);

        File screenshotReport = new File(outputDirectory, Digest.ofTextValue("net.thucydides.core.reports.integration.AbstractReportGenerationTest/a_user_story_should_do_this") + "_screenshots.html");
View Full Code Here

        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.generateReportFor(testOutcome, allTestOutcomes);

        File screenshotReport = new File(outputDirectory, Digest.ofTextValue("net.thucydides.core.reports.integration.AbstractReportGenerationTest/a_user_story_should_do_this") + "_screenshots.html");
View Full Code Here

        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.generateReportFor(testOutcome, allTestOutcomes);

        File testReport = new File(outputDirectory, Digest.ofTextValue("net.thucydides.core.reports.integration.AbstractReportGenerationTest/a_user_story_should_do_this") + ".html");
View Full Code Here

        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("qualifier");

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

        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);
View Full Code Here

        File sourceFile = FileSystemUtils.getResourceAsFile(screenshotResource);// new File(sourcePath.getPath());
        FileUtils.copyFileToDirectory(sourceFile, outputDirectory);

        TestStep step = TestStepFactory.successfulTestStepCalled(stepName);

        step.addScreenshot(new ScreenshotAndHtmlSource(new File(outputDirectory, screenshot), null));

        testOutcome.recordStep(step);
    }
View Full Code Here

    private boolean thisIsANew(ScreenshotAndHtmlSource screenshotAndHtmlSource) {
        if (screenshots.isEmpty()) {
            return true;   
        } else {
            ScreenshotAndHtmlSource latestScreenshotAndHtmlSource = screenshots.get(screenshots.size() - 1);
            return !latestScreenshotAndHtmlSource.equals(screenshotAndHtmlSource);
        }
    }
View Full Code Here

        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

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

        TestStep step1 = TestStepFactory.successfulTestStepCalled("step 1");
        step1.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));
        testOutcome.recordStep(step1);
        testOutcome.recordStep(TestStepFactory.failingTestStepCalled("step 2"));

        File xmlReport = reporter.generateReportFor(testOutcome, allTestOutcomes);
        String generatedReportText = getStringFrom(xmlReport);
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.