18. Trace Viewer Debugging & HTML Test Reports

Diagnostic Traces & Reports

// In playwright.config.js:
export default {
  reporter: [["html", { open: "never" }]],
  use: {
    trace: "retain-on-failure",
    screenshot: "only-on-failure",
  },
};
# View last report:
npx playwright show-report

# Open trace file:
npx playwright show-trace test-results/trace.zip

Task

  • Implement calculatePassPercentage:
  • 1. Accept passedCount and totalCount numbers.
  • 2. Return (passedCount / totalCount) * 100 rounded to 1 decimal place. Return 0 if totalCount is 0.
πŸ’‘Common doubts
Did you like the problem?
Lesson 18 of 18
JavaScript
Loading code editor…