Fix security vulnerabilities, infinite recursion bug, resource leaks, migrate to ESM for CodeceptJS 4.x, and add UI e2e tests #700
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
| # This to verify lib version bump doesn't break anything | |
| name: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org/ | |
| - run: git config --global user.name "GitHub CD bot" | |
| - run: git config --global user.email "github-cd-bot@example.com" | |
| - name: Install deps | |
| run: npm i -g wait-for-localhost-cli && PUPPETEER_SKIP_DOWNLOAD=true npm i --legacy-peer-deps | |
| - name: Run unit tests | |
| run: npm test | |
| - name: Build frontend | |
| run: NODE_OPTIONS=--openssl-legacy-provider npm run build | |
| - name: Start app and run tests | |
| timeout-minutes: 10 | |
| run: | | |
| node bin/codecept-ui.js -c node_modules/@codeceptjs/examples/codecept.conf.js & | |
| BACKEND_PID=$! | |
| echo "Backend PID: $BACKEND_PID" | |
| timeout 90 bash -c 'until curl -sf http://localhost:3333 > /dev/null 2>&1; do echo "Waiting for backend..."; sleep 3; done' \ | |
| || { echo "Backend failed to start within 90s"; kill $BACKEND_PID 2>/dev/null; exit 1; } | |
| echo "Backend is up" | |
| cd test/e2e | |
| npm i | |
| npx playwright install chromium | |
| npx playwright install-deps chromium | |
| npm run test | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |