This thread is trying to answer question "How can I get a single report from all shards using playwright-slack-report? How do I connect test results to slack? Does playwright support match with frame_locator?"
Use blob reporter and then merge report CLI with custom config https://playwright.dev/docs/test-sharding#merge-reports-cli. Put your slack reporter in that custom config. That might work.
Due to slack-playwright-report being a playwright reporter it posts a slack message as a part of the test execution. You’ll need to handle merging reports form multiple shards outside of the playwright test node process.
The article I handle this prior to the new functionality Playwright team released, but I do have a link the the P/R with the changes using the merge-reports-cli towards the top of the article.
I have used slack webhook : [ "playwright-slack-report/dist/src/SlackReporter", { slackWebHookUrl: "https://hooks.slack.com/services/TXXXXXU807/BXXXX30/bzGBXXXXXXCiuAXXXvsn", sendResults: "on-failure", // "always" , "on-failure", "off" }, ], ],
this one didnt work ( I am getting errors like: TypeError: Cannot read properties of undefined (reading 'addTestResult') or Neither slack webhook url, slackOAuthToken nor process.env.SLACK_BOT_USER_OAUTH_TOKEN were found finished building report) Even if I passed it to the custom config
Try following steps:
1, Executes test in sharding mode normally with this custom reporter monocart-reporter
2, Merge shard reports, see here https://github.com/cenfun/monocart-reporter#merge-shard-reports
3, Slack Integration with onEnd
hook
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].