debuggins CI issues 2 #26
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| env: | |
| EMAIL: ${{ secrets.APP_EMAIL }} | |
| PASSWORD: ${{ secrets.APP_PASSWORD }} | |
| BASE_URL: ${{ secrets.APP_BASE_URL }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run Cucumber tests | |
| run: npx cucumber-js --tags "@registration" | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: test-report/ | |
| if-no-files-found: ignore # prevent error if report is missing | |
| retention-days: 30 | |
| - name: Upload Playwright Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-artifacts | |
| path: | | |
| tests/artifacts/screenshots | |
| tests/artifacts/videos | |
| tests/artifacts/traces | |
| - name: Curl registration page in Actions | |
| run: curl -v {BASE_URL}/auth/register | |
| - name: Debug variables | |
| run: | | |
| echo "EMAIL: $EMAIL" | |
| echo "PASSWORD: $PASSWORD" | |
| echo "BASE_URL: $BASE_URL" | |
| - name: Check BASE_URL present | |
| run: '[ -z "$BASE_URL" ] && echo "BASE_URL is missing" || echo "BASE_URL is set"' | |