sel2/README.md
Александров Александр Владимирович 97f6075658 allure added
2025-07-01 23:14:41 +03:00

34 lines
817 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Изменён pom файл для отображения allure отчётов.
Успешно собирается в allure-reports/
Добавлена возможность скриншотов по шагам
```
AllureUtils.attachScreenshot()
```
а также при ошибках
```@Rule
public MyAllureListener allureListener = new MyAllureListener();
```
```
public class MyAllureListener extends TestWatcher {
@Override
protected void failed(Throwable e, Description description) {
takeScreenshot();
}
@Attachment(value = "Screenshot on failure", type = "image/png")
public byte[] takeScreenshot() {
return ((TakesScreenshot) DriverManager.getDriverManager().getDriver())
.getScreenshotAs(OutputType.BYTES);
}
}
```
![img.png](img.png)