
Метод в классе Step:
Код: Выделить всё
@Then("User verifies the Sign In button on the website")
public void user_verifies_the_sign_in_button_on_the_website() {
assertThat(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("sign in menu")).first());
byte[] screenshot=page.screenshot(new Page.ScreenshotOptions()
.setPath(Paths.get("./TestScreenshots/Login.png")));
scenario.attach(screenshot, "image/png", screenshot.toString());
// scenario.attach(screenshot, "image/png", "Login");--- Giving same issue
}
Код: Выделить всё
extent.reporter.spark.start=true
extent.reporter.spark.out=target/Cucumber-Reports/extent-Report.html
extent.reporter.spark.config=src/test/resources/spark-config.xml
screenshot.dir=TestScreenshots/
screenshot.rel.path=../.././TestScreenshots/
Код: Выделить всё
@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/features",
glue = {"stepdefinitions"},
plugin = {"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"})
public class PageRunnerTest {
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... when-using