Rayrun

How can I modify the line reporter in Playwright Test to display the total number of tests?

Answer

Displaying Total Number of Tests in Playwright Test

You can customize the line reporter in Playwright Test to display the total number of tests. This can be done by modifying the playwright.config.ts file.

Here's how you can do it:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['line', { printSummary: true }]],
});

The printSummary: true option will make the line reporter display the total number of tests at the end of each line. This gives you a detailed overview of your test suite progress.

When you run your tests using npx playwright test --reporter=line, your output will look something like this:

Running 124 tests using 6 workers
1) dot-reporter.spec.ts:20:1 › render expected (1/124)

The (1/124) indicates that this is the first out of 124 total tests being executed. This way, you can track how many tests have been executed out of the total number.

References

Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

Related Discord Threads

Related Questions

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].