E2E Tests #159
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: E2E Tests | |
| on: | |
| schedule: | |
| # Run at midnight UTC every day | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| # Allow manual trigger | |
| inputs: | |
| base_url: | |
| description: 'Base URL to test against' | |
| required: false | |
| default: 'https://lotsof.tools' | |
| permissions: | |
| contents: write | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Playwright and dependencies | |
| run: | | |
| npm init -y | |
| npm install @playwright/test @axe-core/playwright | |
| npx playwright install --with-deps chromium | |
| - name: Run E2E tests | |
| run: npx playwright test tests/e2e/functional --config=tests/e2e/playwright.config.js --project=chromium --workers=4 | |
| env: | |
| BASE_URL: ${{ github.event.inputs.base_url || 'https://lotsof.tools' }} | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Upload test screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test-screenshots | |
| path: test-results/ | |
| retention-days: 7 |