Skip to content

Commit

Permalink
Update playwright.yml to try to include snapshot updates step
Browse files Browse the repository at this point in the history
  • Loading branch information
infinia-yzl committed Dec 28, 2024
1 parent f98ea1f commit 2a4722b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
issues: write # For manual-approval
contents: write # For pushing snapshot updates
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -22,18 +25,25 @@ jobs:
env:
BASE_URL: ${{ github.event.deployment_status.environment_url }}

- name: Wait for user input
- name: Wait for snapshot update approval
if: steps.run-tests.outcome == 'failure'
uses: trstringer/manual-approval@v1
with:
secret: ${{ github.TOKEN }}
approvers: ${{ github.actor }}
minimum-approvals: 1
message: 'Tests failed - Update snapshots?'
issue-title: "Playwright Snapshot Update Required"
issue-body: "Playwright tests failed. Would you like to update the snapshots?"

- name: Update snapshots
if: steps.run-tests.outcome == 'failure'
run: npx playwright test --update-snapshots
run: |
npx playwright test --update-snapshots
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"
git add .
git commit -m "test: update playwright snapshots" || echo "No changes to commit"
git push
env:
BASE_URL: ${{ github.event.deployment_status.environment_url }}

Expand Down

0 comments on commit 2a4722b

Please sign in to comment.