From 30e3299db63a5587c76d0745665e0dd615e29e31 Mon Sep 17 00:00:00 2001 From: Egor Kuzin Date: Thu, 13 Jul 2023 23:44:22 +0300 Subject: [PATCH] ci: headless e2e --- .github/workflows/pull-request.yml | 8 ++++---- playwright.config.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6222ae208..fdb969713 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,7 +1,5 @@ name: pull-request on: - push: - branches: [ "master" ] pull_request: branches: [ "master" ] @@ -20,6 +18,8 @@ jobs: tests: runs-on: ubuntu-latest needs: lint + env: + CI: true steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -28,9 +28,9 @@ jobs: - name: Install deps run: npm ci - name: Run unit tests - run: CI=true npm run test + run: npm run test - name: Install Playwright Browsers - run: npx playwright install --with-deps + run: npx playwright install chromium --with-deps - name: Run Playwright tests run: npm run e2e - uses: actions/upload-artifact@v3 diff --git a/playwright.config.ts b/playwright.config.ts index bc096fb04..ebb22ae0c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -42,7 +42,7 @@ const config: PlaywrightTestConfig = { /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: "on-first-retry", - headless: false, + headless: !!process.env.CI, }, /* Configure projects for major browsers */