playwright-community / playwright-msteams-reporter

Microsoft Teams reporter for Playwright
https://www.npmjs.com/package/playwright-msteams-reporter
MIT License
10 stars 4 forks source link

[Question] Send notification after running tests on multiple jobs #20

Open OlesNikon opened 2 days ago

OlesNikon commented 2 days ago

Hello @estruyf, I'm using the playwright-msteams-reporter to send test reports to Microsoft Teams as part of my CI workflow. To optimize test execution time, I want to run Playwright tests across multiple parallel jobs (shards). After all test jobs have completed, I’d like to send a single, consolidated report to MS Teams.

Is it possible to configure playwright-msteams-reporter to aggregate reports from multiple jobs and send a unified notification to Teams?

estruyf commented 1 day ago

Hi @OlesNikon, I believe you should be able to gather all shards and run the npx playwright merge-reports with a configuration file like this:

npx playwright merge-reports --config=merge.config.ts ./blob-reports

The config (merge.config.ts):

import type { MsTeamsReporterOptions } from "playwright-msteams-reporter";

export default {
  testDir: "./tests",
  reporter: [
    [
      'playwright-msteams-reporter',
      <MsTeamsReporterOptions>{
        webhookUrl: <webhook URL>,
        title: "Merged E2E Test Results",
        debug: true,
      },
    ],
  ],
};

I've verified it locally, can you check it on your end?