This project implements Allure integration with Playwright Test framework.
npm i -D @playwright/test allure-playwrightor via yarn:
yarn add @playwright/test allure-playwright --devEither add allure-playwright into playwright.config.ts:
{
reporter: "allure-playwright";
}Or pass the same value via command line:
npx playwright test --reporter=line,allure-playwrightSpecify location for allure results:
Mac / Linux
ALLURE_RESULTS_DIR=my-allure-results npx playwright test --reporter=line,allure-playwrightWindows
set ALLURE_RESULTS_DIR=my-allure-results
npx playwright test --reporter=line,allure-playwrightYou can use allure labels to provide extra information about tests such via
- label
- link
- id
- epic
- feature
- story
- suite
- parentSuite
- subSuite
- owner
- severity
- tag
- issue
- tms
import { test, expect } from "@playwright/test";
import { allure } from "allure-playwright";
test("basic test", async ({ page }, testInfo) => {
allure.epic("Some Epic");
allure.story("Some Story");
});import { test, expect } from "@playwright/test";
import { allure } from "allure-playwright";
test("basic test", async ({ page }, testInfo) => {
allure.link({ url: "https://playwright.dev", name: "playwright-site" });
allure.issue({
url: "https://github.com/allure-framework/allure-js/issues/352",
name: "Target issue",
});
});import { test, expect } from "@playwright/test";
test("basic test", async ({ page }, testInfo) => {
const path = testInfo.outputPath("screenshot.png");
await page.screenshot({ path });
testInfo.attachments.push({ name: "screenshot", path, contentType: "image/png" });
});