Try and run on a playwright image #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Playwright Tests | |
| on: | |
| push: | |
| branches: [main, e2e-tests] | |
| pull_request: | |
| branches: [main, e2e-tests] | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.55.0-jammy | |
| options: --user 1001 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build Next.js application | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_WORKOS_REDIRECT_URI: ${{ vars.NEXT_PUBLIC_WORKOS_REDIRECT_URI }} | |
| - name: Run Playwright tests | |
| run: npx playwright test | |
| env: | |
| # Test environment variables | |
| WORKOS_API_KEY: ${{ secrets.WORKOS_API_KEY }} | |
| WORKOS_CLIENT_ID: ${{ secrets.WORKOS_CLIENT_ID }} | |
| WORKOS_COOKIE_PASSWORD: ${{ secrets.WORKOS_COOKIE_PASSWORD }} | |
| TEST_BASE_URL: http://localhost:3000 | |
| TEST_EMAIL: ${{ secrets.TEST_EMAIL }} | |
| TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
| - name: Upload Playwright Report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 1 | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: test-results | |
| path: test-results/ | |
| retention-days: 1 |