Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

allure-playwright

This project implements Allure integration with Playwright Test framework.

Installation

npm i -D @playwright/test allure-playwright

or via yarn:

yarn add @playwright/test allure-playwright --dev

Usage

Either add allure-playwright into playwright.config.ts:

{
  reporter: "allure-playwright";
}

Or pass the same value via command line:

npx playwright test --reporter=line,allure-playwright

Specify location for allure results:

Mac / Linux

ALLURE_RESULTS_DIR=my-allure-results npx playwright test --reporter=line,allure-playwright

Windows

set ALLURE_RESULTS_DIR=my-allure-results
npx playwright test --reporter=line,allure-playwright

Proving extra information

You 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

Labels Usage

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");
});

Links Usage

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",
  });
});

Attachments Usage

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" });
});