Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Attachments

Ivan Krutov edited this page May 22, 2014 · 13 revisions

A file with additional information captured during a test such as log, screenshot, log file, dump, server response and so on. When some test fails attachments help to understand the reason of failure faster.

An attachment in Java code is simply a method annotated with @Attachment returns either String or File which should be added to report:

@Attachment
public String performedActions(ActionSequence actionSequence) {
    return actionSequence.toString();
}

@Attachment(name = "Page screenshot", type = "image/png")
public byte[] saveScreenshot(byte[] screenShot) {
    return screenShot;
}