Package net.thucydides.core.images

Examples of net.thucydides.core.images.ResizableImage


        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


        File screenshotFile = photographer.takeScreenshot().get();

        waitUntilFileIsWritten(screenshotFile);
        screenshotProcessor.terminate();

        ResizableImage image = ResizableImage.loadFrom(screenshotFile);

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

        }
    }

    private File resizedImage(File screenshotFile, int maxHeight) throws IOException {
        String resizedScreenshotFilename = "scaled_" + screenshotFile.getName();
        ResizableImage scaledImage = ResizableImage.loadFrom(screenshotFile).rescaleCanvas(maxHeight);

        File scaledFile = new File(sourceDirectory, resizedScreenshotFilename);
        scaledImage.saveTo(scaledFile);

        if (shouldKeepOriginalScreenshots) {
            saveCopyOf(screenshotFile);
        }
        screenshotFile.delete();
View Full Code Here

TOP

Related Classes of net.thucydides.core.images.ResizableImage

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.