Rayrun
← Back to Discord Forum

Anyone use playwright-slack-report? I need help with such reports from CICD

Hey,guys. Anyone use this reporter to send messages to slack? I am using this reporter on CICD ( buildkite) but I am getting report from each shard instead of 1 overall result, anyone know how to make 1 message contains all reasults instead of 10 messages from 10 shards?

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?"

14 replies

@??? Sorry for tagging you, but could you help with it to me?

Some screenshots how setup and result looks like

Screenshot_2023-09-28_at_15.37.10.png

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.

If it won't then I'd suggest to write your own custom slack reporter.

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.

https://playwrightsolutions.com/how-do-you-handle-combining-html-json-reports-and-a-slack-message-after-a-playwright-test-is-run-with-the-shard-command/

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.

@fotbee: hi, can you tell me what are the steps you made to connect test result to slack?

hi, can you tell me what are the steps you made to connect test result to slack?

@tall0763: 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" }, ], ],

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" }, ], ],

It is an example of reporter from the config

But still I could not handle 1 report to slack even after merging all blob reports to one

@skorp32: 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

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

Does playwright support match with frame_locator? I have an (iframe[name="xcomponent__ppbutton__4_blah_blah_blah_super_long_str_""]).get_bay_label"

I want to search by "xcomponent_ppbutton4".

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.