Package org.arquillian.extension.recorder.screenshooter

Examples of org.arquillian.extension.recorder.screenshooter.Screenshot


            FileUtils.copyFile(((TakesScreenshot) browser).getScreenshotAs(OutputType.FILE), screenshotToTake);
        } catch (Exception e) {
            throw new RuntimeException("Error during saving the screenshot!", e);
        }

        Screenshot screenshoot = new BrowserScreenshot();
        screenshoot.setResource(screenshotToTake);
        screenshoot.setResourceType(screenshotType);

        try {
            BufferedImage bimg = ImageIO.read(screenshotToTake);
            screenshoot.setWidth(bimg.getWidth());
            screenshoot.setHeight(bimg.getHeight());
        } catch (IOException e) {
            throw new RuntimeException("Unable to get width and height of taken image located at "
                + screenshoot.getResource().getAbsolutePath());
        }

        takenResourceRegister.addTaken(screenshoot);

        return screenshoot;
View Full Code Here


            File screenshotTarget = new File(
                    new File(takeScreenshotEvent.getMetaData().getTestClassName(), takeScreenshotEvent.getMetaData().getTestMethodName()),
                    takeScreenshotEvent.getFileName());

            Screenshot screenshot = screenshooter.get().takeScreenshot(screenshotTarget, screenshotType);
            takenScreenshotsRegister.get().addTaken(screenshot);

            takeScreenshotEvent.getMetaData().setHeight(screenshot.getHeight());
            takeScreenshotEvent.getMetaData().setWidth(screenshot.getWidth());
            screenshot.setResourceMetaData(takeScreenshotEvent.getMetaData());

            ScreenshotEntry propertyEntry = new ScreenshotEntry();
            propertyEntry.setPath(screenshot.getResource().getAbsolutePath());
            propertyEntry.setPhase(takeScreenshotEvent.getWhen());
            propertyEntry.setType(screenshot.getResourceType().toString());
            propertyEntry.setSize(Long.toString(screenshot.getResource().length()));
            propertyEntry.setWidth(screenshot.getWidth());
            propertyEntry.setHeight(screenshot.getHeight());

            takenScreenshotsRegister.get().addReported(screenshot);
            propertyReportEvent.fire(new PropertyReportEvent(propertyEntry));
    }
View Full Code Here

        File screenshotTarget = new File(
            new File(event.getMetaData().getTestClassName(), event.getMetaData().getTestMethodName()),
            event.getFileName());

        Screenshot screenshot = screenshooter.get().takeScreenshot(screenshotTarget, type);
        takenScreenshotsRegister.get().addTaken(screenshot);

        event.getMetaData().setHeight(screenshot.getHeight());
        event.getMetaData().setWidth(screenshot.getWidth());
        screenshot.setResourceMetaData(event.getMetaData());

        ScreenshotEntry propertyEntry = new ScreenshotEntry();
        propertyEntry.setPath(screenshot.getResource().getAbsolutePath());
        propertyEntry.setPhase(event.getWhen());
        propertyEntry.setType(screenshot.getResourceType().toString());
        propertyEntry.setSize(Long.toString(screenshot.getResource().length()));
        propertyEntry.setWidth(screenshot.getWidth());
        propertyEntry.setHeight(screenshot.getHeight());

        takenScreenshotsRegister.get().addReported(screenshot);
        propertyReportEvent.fire(new PropertyReportEvent(propertyEntry));
    }
View Full Code Here

TOP

Related Classes of org.arquillian.extension.recorder.screenshooter.Screenshot

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.