← Каталог
E2E-тесты и CI с Playwright и GitHub Actions — GitHub Actions — workflow для E2E
Фрагмент из «E2E-тесты и CI с Playwright и GitHub Actions»: GitHub Actions — workflow для E2E.
name: E2E tests
on:
push:
branches: [main]
pull_request:
jobs:
playwright:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx playwright install --with-deps
- name: Run Playwright
run: npx playwright test
env:
BASE_URL: ${{ secrets.STAGING_URL }}
E2E_USER: ${{ secrets.E2E_USER }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7 name: E2E tests
on:
push:
branches: [main]
pull_request:
jobs:
playwright:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx playwright install --with-deps
- name: Run Playwright
run: npx playwright test
env:
BASE_URL: ${{ secrets.STAGING_URL }}
E2E_USER: ${{ secrets.E2E_USER }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7