Rayrun

What are the steps to view and generate a report of Playwright tests in a GitHub Action?

Answer

Generating and Viewing Playwright Test Reports in GitHub Actions

First, create a GitHub repository and initialize it with git init. This will let you manage your code.

git init

Next, navigate to the Workflows tab on GitHub to check your test results. Click on the Details link in the PR status check for more information.

To see test logs and error messages, select the workflow run and click on "Run Playwright tests".

To create an HTML report, go to the Artifacts section and download "playwright-report" as a zip file. Extract the zip file into a folder with Playwright installed.

npx playwright show-report <extracted-folder>

This command will serve the report locally for you to view in your browser.

To include all files for creating a trace in a GitHub Action with Playwright CLI or trace.playwright.dev:

  1. For Playwright CLI:
npx playwright show-trace trace.zip
  1. For trace.playwright.dev, upload trace files to https://trace.playwright.dev/ or open remote traces with their URL.
npx playwright show-trace https://ray.run/trace.zip

Remember, CORS rules may apply when accessing remote traces.

For more detailed steps, refer to the official Playwright and GitHub Actions documentation.

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].