test: playwright github action is updated (#1286)

* test: playwright github action is updated

Co-authored-by: Pranshu Chittora <pranshu@signoz.io>
This commit is contained in:
Palash 2022-06-24 19:21:23 +05:30 committed by GitHub
parent 282c47def8
commit 47e6e00a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -1,22 +1,24 @@
name: Playwright Tests name: Playwright Tests
on: on: [pull_request]
deployment_status:
jobs: jobs:
test: playwright:
defaults:
run:
working-directory: frontend
timeout-minutes: 60 timeout-minutes: 60
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: "14.x" node-version: "16.x"
- name: Install dependencies - name: Install dependencies
run: npm ci run: CI=1 yarn install
- name: Install Playwright - name: Install Playwright
run: npx playwright install --with-deps run: npx playwright install --with-deps
- name: Run Playwright tests - name: Run Playwright tests
run: npm run test:e2e run: yarn playwright
env: env:
# This might depend on your test-runner/language binding # 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 }}

View File

@ -11,7 +11,7 @@ const config: PlaywrightTestConfig = {
testDir: './tests', testDir: './tests',
use: { use: {
trace: 'retain-on-failure', trace: 'retain-on-failure',
baseURL: process.env.FRONTEND_API_ENDPOINT, baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3301',
}, },
updateSnapshots: 'all', updateSnapshots: 'all',
fullyParallel: false, fullyParallel: false,