Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ua.net.azhytnytskyi.housework;
- import com.codeborne.selenide.Screenshots;
- import com.google.common.io.Files;
- import org.junit.After;
- import ru.yandex.qatools.allure.annotations.Attachment;
- import java.io.File;
- import java.io.IOException;
- public class WithAttachedScreenshotForEachTest extends BasicTest {
- @After
- public void takeScreenshot() {
- try {
- screenshot();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- @Attachment(type = "image/png")
- public byte[] screenshot() throws IOException {
- File screenshot = Screenshots.takeScreenShotAsFile();
- return Files.toByteArray(screenshot);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement