Skip to content

Commit

Permalink
support links in string metadata for playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed Jan 29, 2025
1 parent 2084a49 commit 5f08333
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/allure-playwright/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class AllureReporter implements ReporterV2 {
const result: Partial<TestResult> = {
name: titleMetadata.cleanTitle,
labels: [...titleMetadata.labels, ...getEnvironmentLabels()],
links: [],
links: [...titleMetadata.links],
parameters: [],
steps: [],
testCaseId: md5(testCaseIdBase),
Expand Down
5 changes: 4 additions & 1 deletion packages/allure-playwright/test/spec/titleMetadata.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ it("has metadata from title", async () => {
"sample.test.js": `
import { test } from '@playwright/test';
test('some strange name to test @allure.id=228 @allure.label.tag=slow @allure.label.labelName=labelValue', async ({}, testInfo) => {
test('some strange name to test @allure.id=228 @allure.label.tag=slow @allure.label.labelName=labelValue @allure.link.my_link=https://allurereport.org', async ({}, testInfo) => {
});
`,
});
Expand All @@ -21,6 +21,9 @@ it("has metadata from title", async () => {
{ name: LabelName.TAG, value: "slow" },
{ name: "labelName", value: "labelValue" },
]),
links: expect.arrayContaining([
{ type: "my_link", url: "https://allurereport.org" },
]),
}),
]);
});
Expand Down

0 comments on commit 5f08333

Please sign in to comment.