Skip to content

Screenshot not embedded into HTML report on 1.0.2 update #5

@kathyrollo

Description

@kathyrollo

Summary

Screenshots stopped working in HTML reports after updating to 1.0.2 but works with 1.0.1.

Current Status

// hook
@AfterStep
public void afterStep(Scenario scenario) throws Throwable {
	byte[] imgBytes = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
	scenario.embed(imgBytes, "image/png");
}

// extent.properties
extent.reporter.avent.start=false
extent.reporter.bdd.start=false
extent.reporter.cards.start=false
extent.reporter.email.start=false
extent.reporter.html.start=true
extent.reporter.klov.start=false
extent.reporter.logger.start=true
extent.reporter.tabular.start=false

extent.reporter.avent.config=
extent.reporter.bdd.config=
extent.reporter.cards.config=
extent.reporter.email.config=
extent.reporter.html.config=
extent.reporter.klov.config=
extent.reporter.logger.config=
extent.reporter.tabular.config=

extent.reporter.avent.out=target/extentreports-cucumber/AventReport/
extent.reporter.bdd.out=target/extentreports-cucumber/BddReport/
extent.reporter.cards.out=target/extentreports-cucumber/CardsReport/
extent.reporter.email.out=target/extentreports-cucumber/EmailReport/ExtentEmail.html
extent.reporter.html.out=target/extentreports-cucumber/HtmlReport/ExtentHtml.html
extent.reporter.logger.out=target/extentreports-cucumber/LoggerReport/
extent.reporter.tabular.out=target/extentreports-cucumber/TabularReport/

screenshot.dir=target/extentreports-cucumber/Screenshots/

How to Replicate

Update to 1.0.2. No other code or config changes.

<dependency>
	<groupId>com.aventstack</groupId>
	<artifactId>extentreports-cucumber3-adapter</artifactId>
	<version>1.0.2</version>
</dependency>

Screenshots

1.0.1

Screenshots are attached after each step. Hook calls are hidden which gives a natural reading flow.
sshot_101

1.0.2

Screenshots disappear. Hook calls appear like boilerplate which makes it unnatural for business stakeholders.
sshot_102

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions