Rayrun
← Back to Discord Forum

PLAYWRIGHT_HTML_REPORT env setting not used consistently

I wanted to have my Playwright reports generated in a specific folder (other than default) for an unrelated requirement. I set the PLAYWRIGHT_HTML_REPORT as an environment variable (with dotenv) and successfully got the report generated there The problem is that npx playwright show-report - which should show me the last generated report - does not seem to honor this setting As a result, my script always fails to find the generated report until I manually add that path as an argument into the show-report command.

Is this the correct and expected behavior or am I missing something that would allow show-report to find the last report correctly using the env var

This thread is trying to answer question "Is it expected behavior for the `npx playwright show-report` command to not find the last report correctly using the `PLAYWRIGHT_HTML_REPORT` environment variable, or is there a way to make it do so?"

2 replies

You can pass path to show report command to launch report in some other directory

Anyway since it’s a different command and it does not trigger config nor does it load env variables it can’t automatically know where you put your report and if path is not specified it uses default path

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.