com.aventstack.extentreports.MediaEntityBuilder Java Examples

The following examples show how to use com.aventstack.extentreports.MediaEntityBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RawEntityConverter.java    From extentreports-java with Apache License 2.0 5 votes vote down vote up
private void addMedia(Log log, ExtentTest extentTest, Throwable ex) {
    Media m = log.getMedia();
    if (m.getPath() != null) {
        extentTest.log(log.getStatus(), ex,
                MediaEntityBuilder.createScreenCaptureFromPath(m.getPath()).build());
    } else if (((ScreenCapture) m).getBase64() != null) {
        extentTest.log(log.getStatus(), ex,
                MediaEntityBuilder.createScreenCaptureFromBase64String(((ScreenCapture) m).getBase64())
                        .build());
    }
}
 
Example #2
Source File: ExtentReportsBuilder.java    From courgette-jvm with MIT License 5 votes vote down vote up
private void addBase64ScreenCapture(ExtentTest node, String base64Image) {
    try {
        node.log(Status.INFO, "", MediaEntityBuilder.createScreenCaptureFromBase64String(base64Image).build());
    } catch (IOException e) {
        System.err.println("[Courgette Extent Reports Plugin] Unable to embed image. Reason: " + e.getMessage());
    }
}