Package net.thucydides.core.screenshots

Examples of net.thucydides.core.screenshots.Photographer


        environmentVariables.setProperty("thucydides.browser.height", "400");

        driver = testSite.open("phantomjs");

        ScreenshotProcessor screenshotProcessor = new SingleThreadScreenshotProcessor(environmentVariables);
        Photographer photographer = new Photographer(driver, screenshotDirectory,screenshotProcessor);
        File screenshotFile = photographer.takeScreenshot().get();

    waitUntilFileIsWritten(screenshotFile);

        ResizableImage image = ResizableImage.loadFrom(screenshotFile);
View Full Code Here


    public void should_only_store_one_file_for_identical_screenshots() throws Exception {

        driver = testSite.open("phantomjs");

        ScreenshotProcessor screenshotProcessor = new SingleThreadScreenshotProcessor(environmentVariables);
        Photographer photographer = new Photographer(driver, screenshotDirectory,screenshotProcessor);
        File screenshot1File = photographer.takeScreenshot().get();
        File screenshot2File = photographer.takeScreenshot().get();

        screenshotProcessor.terminate();
        waitUntilFileIsWritten(screenshot1File);
        waitUntilFileIsWritten(screenshot2File);
        assertThat(screenshot1File.getName(), equalTo(screenshot2File.getName()));
View Full Code Here

        environmentVariables.setProperty("thucydides.resized.image.width", "300");

        driver = testSite.open("phantomjs");

        ScreenshotProcessor screenshotProcessor = new SingleThreadScreenshotProcessor(environmentVariables);
        Photographer photographer = new Photographer(driver, screenshotDirectory, screenshotProcessor);
        File screenshotFile = photographer.takeScreenshot().get();

        waitUntilFileIsWritten(screenshotFile);
        screenshotProcessor.terminate();

        ResizableImage image = ResizableImage.loadFrom(screenshotFile);
View Full Code Here

    @Test
    public void should_take_screenshots_correctly() throws IOException {
        driver = testSite.open("http:www.google.com", "screenshots/google.html", "phantomjs");

        Photographer photographer = new Photographer(driver, screenshotDirectory);
        File screenshotFile = photographer.takeScreenshot().get();

    waitUntilFileIsWritten(screenshotFile);

        assertThat(screenshotFile.exists(), is(true));
    }
View Full Code Here

    @Test
    public void should_not_explode_when_firefox_cannot_take_a_large_screenshot() {

        when(mockDriver.getScreenshotAs(OutputType.BYTES)).thenThrow(new WebDriverException());

        Photographer photographer = new Photographer(mockDriver, screenshotDirectory) {
            @Override
            protected Logger getLogger() {
                return logger;
            }
        };
        photographer.takeScreenshot();
    }
View Full Code Here

TOP

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

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.