diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index be8108e6ef..0a6addfaeb 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -1,22 +1,24 @@ name: Playwright Tests -on: - deployment_status: +on: [pull_request] + jobs: - test: + playwright: + defaults: + run: + working-directory: frontend timeout-minutes: 60 runs-on: ubuntu-latest - if: github.event.deployment_status.state == 'success' steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: "14.x" + node-version: "16.x" - name: Install dependencies - run: npm ci + run: CI=1 yarn install - name: Install Playwright run: npx playwright install --with-deps - name: Run Playwright tests - run: npm run test:e2e + run: yarn playwright env: # This might depend on your test-runner/language binding - PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} + PLAYWRIGHT_TEST_BASE_URL: ${{ secrets.PLAYWRIGHT_TEST_BASE_URL }} diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 3fc61908c7..98fccbcb7f 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -11,7 +11,7 @@ const config: PlaywrightTestConfig = { testDir: './tests', use: { trace: 'retain-on-failure', - baseURL: process.env.FRONTEND_API_ENDPOINT, + baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3301', }, updateSnapshots: 'all', fullyParallel: false,