Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Playwright GH Action #364

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions {{cookiecutter.project_slug}}/.github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@ jobs:
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I minor, but important, upgrade I think people often forget to do. 👍

with:
node-version: 18
- name: Install dependencies
run: npm --prefix ./client i
working-directory: ./client
run: npm install
- name: Install Playwright
run: npx --prefix ./client playwright install --with-deps
working-directory: ./client
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx --prefix ./client playwright test --reporter=html
working-directory: ./client
run: npx playwright test --reporter=html
env:
PLAYWRIGHT_TEST_BASE_URL:
{{ "${{ github.event.deployment_status.environment_url }}" }}
PLAYWRIGHT_TEST_USER_PASS:
{{ "${{ secrets.PLAYWRIGHT_TEST_USER_PASS }}" }}
PLAYWRIGHT_TEST_BASE_URL: {{ "${{ github.event.deployment_status.environment_url }}" }}
PLAYWRIGHT_TEST_USER_PASS: {{ "${{ secrets.PLAYWRIGHT_TEST_USER_PASS }}" }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: ./client/playwright-report/
retention-days: 30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR (unless you want it to be), but one issue I observed the other day on a project was that the deployment failed and so we skipped running Playwright because github.event.deployment_status.state did not equal success. But the PR was still green because of the previous playwright run.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense. I will move this to GH issue for later.