Package net.thucydides.core.screenshots

Examples of net.thucydides.core.screenshots.ScreenshotProcessor


        environmentVariables.setProperty("thucydides.browser.width", "640");
        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);

        screenshotProcessor.terminate();
        waitUntilFileIsWritten(screenshotFile);
        assertThat(image.getWitdh(), is(greaterThan(350))); // In Windows the actual dimensions may be are slightly less
    }
View Full Code Here


    @Test
    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);

        assertThat(image.getWitdh(), is(300));
    }
View Full Code Here

TOP

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

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.