Rayrun
← Back to Discord Forum

How can include all files required to create a trace in a GitHub Action

jan.ostgrenposted in #help-playwright
Open in Discord

Standard template for the GitHub Action does not include the required files for creating a trace. Looks like bug, but if you can workaround it , I will be happy.

This thread is trying to answer question "How can one include all files required to create a trace in a GitHub Action?"

6 replies

check your playwright.config.ts file assuming you created a typescript project. The default is trace on-first-retry, if you want to capture all traces change that value to the value 'on'

image.png
image.png

I have trace on option. The issue only occurs when running as GitHub action. It is not a settings issue in the configuration file.

https://bmayhew.github.io/playwright-demo/ <- @playwright/test": "^1.38.1", trace files are included

https://github.com/BMayhew/playwright-demo/tree/master repo is here if you want to stare and compare your way to a solution

@butchmayhew: I was not so simple to re-create this. Do you need to create the blob reports and merge them ?

I was not so simple to re-create this. Do you need to create the blob reports and merge them ?

I have got an advanced solution , but what I also need is simple solution that create the trace.zip file from one test. I don’t have GitHub Pages to publish reports. The output must zip files which you can download.

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.

Related Discord Threads

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 luc@ray.run.