Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public final class AttachmentType {
*/
public static final AttachmentType OCTET_STREAM = new AttachmentType("application/octet-stream", "");

/**
* Predefined attachment type for Playwright trace archives.
*/
public static final AttachmentType PLAYWRIGHT_TRACE = new AttachmentType("application/vnd.allure.playwright-trace", ZIP.getExtension());

private final String mediaType;
private final String extension;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static void attachPageErrors(final String name, final Page page) {
* @param traceZip the path to the trace zip file.
*/
public static void attachTrace(final String name, final Path traceZip) {
attachPath(defaultName(name, TRACE), AttachmentType.ZIP, traceZip);
attachPath(defaultName(name, TRACE), AttachmentType.PLAYWRIGHT_TRACE, traceZip);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.qameta.allure.Param;
import io.qameta.allure.Step;
import io.qameta.allure.model.Attachment;
import io.qameta.allure.model.AttachmentType;
import io.qameta.allure.model.Status;
import io.qameta.allure.model.StatusDetails;
import io.qameta.allure.model.StepResult;
Expand Down Expand Up @@ -361,6 +362,9 @@ void shouldAttachTraceWhenSessionIsClosed() {

assertThat(results.getAttachments())
.hasSize(1);
assertThat(attachments(results))
.extracting(Attachment::getType)
.containsExactly(AttachmentType.PLAYWRIGHT_TRACE.getMediaType());
assertAttachmentStartsWith(results, ZIP_HEADER);
}

Expand All @@ -385,6 +389,9 @@ void shouldAttachTraceWhenContextIsClosed() {

assertThat(results.getAttachments())
.hasSize(1);
assertThat(attachments(results))
.extracting(Attachment::getType)
.containsExactly(AttachmentType.PLAYWRIGHT_TRACE.getMediaType());
assertAttachmentStartsWith(results, ZIP_HEADER);
}

Expand All @@ -408,6 +415,9 @@ void shouldAttachTraceWhenAllureLifecycleStopsTest() {

assertThat(results.getAttachments())
.hasSize(1);
assertThat(attachments(results))
.extracting(Attachment::getType)
.containsExactly(AttachmentType.PLAYWRIGHT_TRACE.getMediaType());
assertAttachmentStartsWith(results, ZIP_HEADER);
}

Expand Down
Loading