This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 required : false
1313 type : boolean
1414 default : false
15+ artifact-repository :
16+ description : ' artifact repository name'
17+ required : false
18+ type : string
19+ default : ' '
20+ artifact-name :
21+ description : ' artifact repository name'
22+ required : false
23+ type : string
24+ default : ' '
25+ artifact-id :
26+ description : ' artifact id'
27+ required : false
28+ type : string
29+ default : ' '
30+ secrets :
31+ github-token :
32+ required : true
33+ outputs :
34+ artifact-id : ${{ steps.upload-playwright-results.outputs.artifact-id }}
35+ artifact-url : ${{ steps.upload-playwright-results.outputs.artifact-url }}
36+ artifact-digest : ${{ steps.upload-playwright-results.outputs.artifact-digest }}
1537
1638jobs :
1739 take-screenshots :
@@ -26,18 +48,24 @@ jobs:
2648 with :
2749 node-version-file : package.json
2850 - run : npm ci
51+ - uses : actions/download-artifact@v4
52+ with :
53+ name : ${{ inputs.artifact-name }}
54+ path : artifacts
55+ github-token : ${{ secrets.github-token }}
56+ repository : ${{ inputs.artifact-repository }}
57+ run-id : ${{ inputs.artifact-id }}
58+ continue-on-error : true
59+ - run : cp -f artifacts/{playwright.config.ts,global-setup.ts,global-teardown.ts} .
2960 - run : npm test ${{ inputs.update-snapshots != 'false' && '-- --update-snapshots' || '' }}
3061 - run : ls -alR
3162 - if : ${{ !cancelled() }}
63+ id : upload-playwright-results
3264 uses : actions/upload-artifact@v4
3365 with :
3466 name : playwright-results
3567 path : |
3668 playwright-report
3769 test-results
38- - if : ${{ !cancelled() }}
39- uses : actions/upload-artifact@v4
40- with :
41- name : playwright-screenshots
42- path : screenshots
70+ screenshots
4371 if-no-files-found : ignore
Original file line number Diff line number Diff line change 66jobs :
77 test :
88 runs-on : ubuntu-latest
9+ outputs :
10+ artifact-id : ${{ steps.artifact.outputs.artifact-id }}
11+ artifact-url : ${{ steps.artifact.outputs.artifact-url }}
12+ artifact-digest : ${{ steps.artifact.outputs.artifact-digest }}
913 steps :
1014 - run : echo "Hello, World!"
15+ # - id: artifact
16+ # uses: actions/upload-artifact@v4
17+ # with:
18+ # name: scripts
19+ # path: |
20+ # playwright.config.ts
21+ # global-setup.ts
22+ # global-teardown.ts
23+ # retention-days: 1
24+ # include-hidden-files: true
1125 take-screenshots :
1226 needs :
1327 - test
1832 https://example.com
1933 https://example.com/2
2034 update-snapshots : true
35+ # artifact-repository: sasaplus1-prototype/workflow-screenshot-with-playwright
36+ # artifact-name: scripts
37+ # artifact-id: ${{ needs.test.outputs.artifact-id }}
38+ secrets :
39+ github-token : ${{ secrets.GITHUB_TOKEN }}
40+ # post:
41+ # needs:
42+ # - take-screenshots
43+ # runs-on: ubuntu-latest
44+ # steps:
45+ # - uses: actions/download-artifact@v4
46+ # with:
Original file line number Diff line number Diff line change 1+ import { expect , test } from "@playwright/test" ;
2+
3+ test ( "should take a full page screenshot of the page" , async ( { page } ) => {
4+ await page . goto ( "https://example.com" ) ;
5+ await expect ( page ) . toHaveScreenshot ( {
6+ fullPage : true ,
7+ } ) ;
8+ } ) ;
Original file line number Diff line number Diff line change 88 },
99 "private" : true ,
1010 "scripts" : {
11- "test" : " playwright test --project=chromium"
11+ "test" : " playwright test --project=chromium index.test.ts "
1212 }
1313}
You can’t perform that action at this time.
0 commit comments