6363 e2e_tests :
6464 runs-on : ubuntu-latest
6565 timeout-minutes : 15
66+ strategy :
67+ fail-fast : false
68+ matrix :
69+ project : [chromium, "Mobile Safari"]
6670 permissions :
6771 contents : read
6872 pull-requests : write
@@ -87,30 +91,30 @@ jobs:
8791 - name : Install Playwright Browsers
8892 run : pnpm playwright install --with-deps
8993
90- - name : Run e2e tests
94+ - name : Run e2e tests (${{ matrix.project }})
9195 env :
9296 AIRTABLE_PAT : ${{ secrets.AIRTABLE_PAT }}
93- run : pnpm test:e2e:headless
97+ run : pnpm test:e2e:headless --project='${{ matrix.project }}'
9498
9599 - name : Upload Playwright report
96100 if : failure()
97101 uses : actions/upload-artifact@v4
98102 with :
99- name : playwright-report
103+ name : playwright-report-${{ matrix.project }}
100104 path : playwright-report/
101105 retention-days : 30
102106
103107 - name : Comment PR with Playwright artifact link
104- if : always () && github.event_name == 'pull_request'
108+ if : failure () && github.event_name == 'pull_request'
105109 uses : actions/github-script@v7
106110 with :
107111 script : |
108112 const runId = context.runId;
109113 const repo = context.repo;
114+ const project = '${{ matrix.project }}';
110115 const artifactUrl = `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`;
111- const identifier = ' <!-- playwright-test-status -->' ;
116+ const identifier = ` <!-- playwright-test-status-${project} -->` ;
112117
113- // Find existing comment
114118 const { data: comments } = await github.rest.issues.listComments({
115119 issue_number: context.issue.number,
116120 owner: repo.owner,
@@ -121,46 +125,32 @@ jobs:
121125 comment.body?.includes(identifier)
122126 );
123127
124- // Determine if tests passed or failed
125- const testsFailed = '${{ job.status }}' !== 'success';
128+ const comment = `${identifier}
129+ ## Playwright Tests Failed (${project})
126130
127- if (testsFailed) {
128- const comment = `${identifier}
129- ## ❌ Playwright Tests Failed
131+ Download the test report artifact for details:
130132
131- The Playwright tests have failed. Please download the test report artifact to see detailed information about the failures:
132-
133- 📊 [View test run and download artifact](${artifactUrl})
133+ [View test run and download artifact](${artifactUrl})
134134
135135 **How to view the report:**
136136 1. Click the link above
137137 2. Scroll to the bottom to the "Artifacts" section
138- 3. Download the \`playwright-report\` artifact
139- 4. Extract the zip file and open \`index.html\` in your browser
140-
141- The report includes screenshots, videos, and detailed traces of the failed tests.`;
142-
143- if (existingComment) {
144- await github.rest.issues.updateComment({
145- owner: repo.owner,
146- repo: repo.repo,
147- comment_id: existingComment.id,
148- body: comment
149- });
150- } else {
151- await github.rest.issues.createComment({
152- issue_number: context.issue.number,
153- owner: repo.owner,
154- repo: repo.repo,
155- body: comment
156- });
157- }
158- } else if (existingComment) {
159- // Tests passed - delete the failure comment
160- await github.rest.issues.deleteComment({
138+ 3. Download the \`playwright-report-${project}\` artifact
139+ 4. Extract the zip file and open \`index.html\` in your browser`;
140+
141+ if (existingComment) {
142+ await github.rest.issues.updateComment({
143+ owner: repo.owner,
144+ repo: repo.repo,
145+ comment_id: existingComment.id,
146+ body: comment
147+ });
148+ } else {
149+ await github.rest.issues.createComment({
150+ issue_number: context.issue.number,
161151 owner: repo.owner,
162152 repo: repo.repo,
163- comment_id: existingComment.id
153+ body: comment
164154 });
165155 }
166156
0 commit comments