Skip to content

Commit

Permalink
Support allure metadata in playwright annotations (closes allure-fram…
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Aftakhov committed Jan 14, 2025
1 parent a1569ff commit 6a92988
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/allure-playwright/test/spec/annotations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, it } from "vitest";
import { LabelName } from "allure-js-commons";
import { runPlaywrightInlineTest } from "../utils.js";

it("should support skip annotation", async () => {
Expand Down Expand Up @@ -56,3 +57,25 @@ it("should support fixme annotation", async () => {
]),
);
});

it("should support allure metadata in playwright annotation", async () => {
const { tests } = await runPlaywrightInlineTest({
"sample.test.js": `
import { test } from '@playwright/test';
test('test full report', {
annotation: [
{ type: "@allure.id", description: "12345"},
{ type: "@allure.label.epic", description: "Smoke"},
],
}, async () => {
});
`,
});

expect(tests).toHaveLength(1);
expect(tests[0].labels).toContainEqual({ name: LabelName.ALLURE_ID, value: "12345" });
expect(tests[0].labels).toContainEqual({ name: LabelName.EPIC, value: "Smoke" });
// TODO add all labels from labels.spec.ts
// TODO add label on test.describe level, like suites tags
});

0 comments on commit 6a92988

Please sign in to comment.