Playwright + JS · Lesson 35 of 35
Module 35: Playwright Configuration & Reporting
Try it yourself
Implement calculateTestPassRate:
The editor has a worked example. Read it, tweak it, then press Mark as complete.
playwright.config.jsimport { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
timeout: 30000,
expect: { timeout: 5000 },
reporter: [
["html", { open: "never" }],
["list"],
["junit", { outputFile: "results.xml" }],
],
use: {
baseURL: process.env.BASE_URL || "https://targetqa.com",
trace: "retain-on-failure",
screenshot: "only-on-failure",
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
],
});Congratulations on reaching the final module of Playwright with JavaScript! In this lesson, we explore complete playwright.config.js architecture and interactive HTML reports. You will learn how to analyze step-by-step actionability call logs and deliver clean test metrics to your engineering team. Happy testing!
Part of the Playwright + JS course (Playwright with JavaScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
The 'playwright-report/' directory is a completely static website. Simply upload that folder as a CI artifact or deploy to GitHub Pages.
Finished reading?
Review the worked example in the editor, then mark the lesson complete.