mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 00:20:07 +00:00
## Summary Allow for secondary trigger for updating screenshots: > Adding a comment starting with `/update-playwright` ## Review Focus - Is this the command you'd expect? - Should I also add `/playwright-update`? ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5960-Devex-Add-additional-trigger-for-Playwright-updates-2856d73d365081768f70d0a8aafa9c11) by [Unito](https://www.unito.io)
61 lines
2.1 KiB
YAML
61 lines
2.1 KiB
YAML
# Setting test expectation screenshots for Playwright
|
|
name: Update Playwright Expectations
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled]
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
( github.event_name == 'pull_request' && github.event.label.name == 'New Browser Test Expectations' ) ||
|
|
( github.event.issue.pull_request &&
|
|
github.event_name == 'issue_comment' &&
|
|
(
|
|
github.event.comment.author_association == 'OWNER' ||
|
|
github.event.comment.author_association == 'MEMBER' ||
|
|
github.event.comment.author_association == 'COLLABORATOR'
|
|
) &&
|
|
startsWith(github.event.comment.body, '/update-playwright') )
|
|
steps:
|
|
- name: Initial Checkout
|
|
uses: actions/checkout@v5
|
|
- name: Pull Request Checkout
|
|
run: gh pr checkout ${{ github.event.issue.number }}
|
|
if: github.event.issue.pull_request && github.event_name == 'issue_comment'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Setup Frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
- name: Setup Playwright
|
|
uses: ./.github/actions/setup-playwright
|
|
- name: Run Playwright tests and update snapshots
|
|
id: playwright-tests
|
|
run: pnpm exec playwright test --update-snapshots
|
|
continue-on-error: true
|
|
working-directory: ComfyUI_frontend
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: ComfyUI_frontend/playwright-report/
|
|
retention-days: 30
|
|
- name: Debugging info
|
|
run: |
|
|
echo "PR: ${{ github.event.issue.number }}"
|
|
git status
|
|
working-directory: ComfyUI_frontend
|
|
- name: Commit updated expectations
|
|
run: |
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@github.com'
|
|
git add browser_tests
|
|
git diff --cached --quiet || git commit -m "[automated] Update test expectations"
|
|
git push
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
working-directory: ComfyUI_frontend
|