playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: json report not generated using merge-reports

Open vvargas90 opened this issue 1 year ago • 2 comments

Version

1.46.1

Steps to reproduce

  1. Generate several blob reports into the /all-blob-reports folder.
  2. Execute npx playwright merge-reports --reporter json ./all-blob-reports to generate a combined json report

Expected behavior

There is a generated report.json file in /playwright-report directory

Actual behavior

The report is displayed as stdout but not stored into any file

Additional context

When running the same command but having as output an html report it does generate all the necessary artifacts in playwright-report folder. Example output:

npx playwright merge-reports --reporter html ./all-blob-reports

merging reports from /Users/my-user/repos/my-project/all-blob-reports
extracting: all-blob-reports/report-chromium.zip
extracting: all-blob-reports/report-ios.zip
extracting: all-blob-reports/report-firefox.zip
extracting: all-blob-reports/report-mobile.zip
merging events
processing test events
building final report
finished building report

Environment

System: OS: macOS 13.5 CPU: (8) arm64 Apple M2 Memory: 75.84 MB / 16.00 GB Binaries: Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm Languages: Bash: 3.2.57 - /bin/bash npmPackages: @playwright/test: ^1.46.1 => 1.46.1

vvargas90 avatar Oct 16 '24 07:10 vvargas90

As a workaround I'm doing npx playwright merge-reports --reporter json ./all-blob-reports > playwright-report/report.json

vvargas90 avatar Oct 16 '24 07:10 vvargas90

You need to pass an environment variable to make it write into a file. See docs. Let me know if you have any other questions.

dgozman avatar Oct 16 '24 14:10 dgozman

Closing as per above.

dgozman avatar Oct 21 '24 08:10 dgozman