Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: publish markdown report as a comment (#23825)

Yury Semikhatsky8fbcffa43e09
diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml
index c9c544f7bd..fcd9cfb42a 100644
--- a/.github/workflows/create_test_report.yml
+++ b/.github/workflows/create_test_report.yml
@@ -44,9 +44,9 @@ jobs:
output_dir: 'blob-report'
connection_string: '${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}'
- - name: Merge into HTML Report
+ - name: Merge reports
run: |
- npx playwright merge-reports --reporter html --attachments missing blob-report
+ npx playwright merge-reports --reporter markdown,html --attachments missing blob-report
- name: Upload HTML report to Azure
run: |
@@ -92,10 +92,16 @@ jobs:
const reportDir = 'run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}';
const reportUrl = `https://mspwblobreport.z1.web.core.windows.net/${reportDir}/index.html`;
core.notice('Report url: ' + reportUrl);
+ const reportMd = await fs.promises.readFile('report.md', 'utf8');
const { data: response } = await github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
- body: `"${{ github.event.workflow_run.name }}" [report](${reportUrl}).`,
+ body: [
+ `### Test results for "${{ github.event.workflow_run.name }}"`,
+ reportMd,
+ '---',
+ `Full [html report](${reportUrl}).`
+ ].join('\n'),
});
core.info('Posted comment: ' + response.html_url);
@@ -108,7 +114,11 @@ jobs:
conclusion: 'success',
details_url: reportUrl,
output: {
- title: 'Merged test results (${{ github.event.workflow_run.name }})',
- summary: `Created [report](${reportUrl}). Merge [workflow run](${mergeWorkflowUrl}).`,
+ title: 'Test results for "${{ github.event.workflow_run.name }}"',
+ summary: [
+ reportMd,
+ '---',
+ `Full [html report](${reportUrl}). Merge [workflow run](${mergeWorkflowUrl}).`
+ ].join('\n'),
}
});