Skip to content

Commit

Permalink
End to end tests (#240)
Browse files Browse the repository at this point in the history
* move end-to-end tests to a workflow that runs on a pull request

* add run statement to set environment config
  • Loading branch information
ethangardner authored Jul 1, 2024
1 parent 292e88b commit 8702b6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/_playwright.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Playwright Tests
on:
workflow_call:

jobs:
end_to_end:
timeout-minutes: 60
Expand All @@ -15,13 +14,20 @@ jobs:
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm --filter=end-to-end-tests exec playwright install --with-deps
- name: Determine E2E_ENDPOINT
run: >
echo E2E_ENDPOINT=$(if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "${{ secrets.PULL_REQUEST_PREVIEW_URL }}/${{ github.head_ref }}";
else
echo "${{ secrets.MAIN_URL }}";
fi) >> $GITHUB_ENV
- name: Run Playwright tests
run: pnpm --filter=end-to-end-tests exec playwright test
env:
E2E_ENDPOINT: ${{ secrets.PULL_REQUEST_PREVIEW_URL }}/${{ github.head_ref }}
E2E_ENDPOINT: ${{ env.E2E_ENDPOINT }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
retention-days: 30
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/_validate.yml
e2e:
needs: [ run-tests ]
uses: ./.github/workflows/_playwright.yml
secrets: inherit

0 comments on commit 8702b6f

Please sign in to comment.