@session-foundation/playwright-reporter
v0.0.7
Published
This package is a custom Playwright reporter that can be used to format the results of our QA runs for Session. It's been made as a package so that we can reuse it for each platforms (android, iOS, desktop, etc).
Readme
Playwright Reporter for Session
This package is a custom Playwright reporter that can be used to format the results of our QA runs for Session. It's been made as a package so that we can reuse it for each platforms (android, iOS, desktop, etc).
Description
It will output the results to console.log and to a CSV file named test-results.csv.
If the tests are running in a CI environment (see isCI below), it will keep the CSV from one run and append the next results to it. That way, the test-results.csv file will contain all the results of all the runs for that CI job, even if npx playwright test is run multiple times.
Usage
To use this reporter, you need to add it to your Playwright configuration file (e.g. playwright.config.ts).
First add @session-foundation/playwright-reporter as a dev dependency on your project.
yarn add -D @session-foundation/playwright-reporterThen, configure it
export default defineConfig = {
reporter: [
['./node_modules/@session-foundation/playwright-reporter/dist/index.js'],
],
};Configuration
You can configure the reporter by setting environment variables.
PRINT_ONGOING_TEST_LOGS: Set to1to print ongoing test logs.PRINT_FAILED_TEST_LOGS: Set to1to print failed test logs.CI: Set to1to indicate that the tests are running in a CI environment. If they are, the CSV file will be kept and appended to.
Note: those are to be defined before defineConfig() is called, so before the playwright suite is started.
Playwright documentation
For more information about Playwright custom reporters, see the Playwright documentation.
