Skip to content

Commit

Permalink
add steps for reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
szczecha committed Jan 16, 2025
1 parent 0e3446c commit fe26411
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 15 deletions.
26 changes: 26 additions & 0 deletions .github/actions/merge-pw-reports/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,29 @@ runs:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14

- name: Merge ctrf reports
shell: bash
run: npx ctrf merge ./ctrf --output merged-ctrf-report.json

- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './ctrf/*.json'
summary-report: true
previous-results-report: true
failed-report: true
flaky-report: true
if: always()

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/merged-ctrf-report.json

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.3.0",
"mochawesome-report-generator": "^6.2.0",
"playwright-ctrf-json-reporter": "^0.0.18",
"playwright-testmo-reporter": "^1.8.4",
"rollup-plugin-polyfill-node": "^0.11.0",
"typescript": "^5.0.4",
Expand Down
31 changes: 16 additions & 15 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ export default defineConfig({
workers: parseInt(env.WORKERS || DEFAULT_WORKERS),
reporter: process.env.CI
? [
["blob"],
["github"],
[
"playwright-testmo-reporter",
{
outputFile: "testmo/testmo.xml", // Optional: Output file path. Defaults to 'testmo.xml'.
embedBrowserType: true, // Optional: Embed browser type in the XML file. Defaults to false.
embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
testStepCategories: ["hook", "expect", "pw:api", "test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
attachmentBasePathCallback: () =>
process.env.URL_TO_RUN ? process.env.URL_TO_RUN : "",
},
],
]
["blob"],
["github"],
[
"playwright-testmo-reporter",
{
outputFile: "testmo/testmo.xml", // Optional: Output file path. Defaults to 'testmo.xml'.
embedBrowserType: true, // Optional: Embed browser type in the XML file. Defaults to false.
embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
testStepCategories: ["hook", "expect", "pw:api", "test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
attachmentBasePathCallback: () =>
process.env.URL_TO_RUN ? process.env.URL_TO_RUN : "",
},
],
["playwright-ctrf-json-reporter", {}]
]
: [["html"], ["list"]],
expect: { timeout: 10 * 1000 },
maxFailures: 10,
Expand Down

0 comments on commit fe26411

Please sign in to comment.