[PB-985]: feature/playwright e2e tests #632
This file contains 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: | |
NODE_ENV: 'staging' | |
REACT_APP_NODE_ENV: 'staging' | |
CI: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.11.1' | |
- run: echo "registry=https://registry.yarnpkg.com/" > .npmrc | |
- run: echo "@internxt:registry=https://npm.pkg.github.com" >> .npmrc | |
- run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }} >> .npmrc | |
- run: echo "always-auth=true" >> .npmrc | |
- run: echo REACT_APP_NODE_ENV=staging >> ./.env | |
- name: Install dependencies | |
run: npm install -g yarn && yarn | |
- name: Install Playwright Browsers | |
run: yarn playwright install --with-deps | |
- name: Start dev server | |
run: yarn start & npx wait-on http://localhost:3000 | |
- name: Run Playwright tests | |
run: yarn playwright test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-artifacts | |
path: test-results/ | |
retention-days: 30 |