feat: add playwright e2e tests infrastructure (#1742)

Co-authored-by: ShubhamPalriwala <spalriwalau@gmail.com>
This commit is contained in:
Dhruwang Jariwala
2023-12-07 16:21:45 +05:30
committed by GitHub
parent 5468287f9b
commit 59936e54a0
10 changed files with 287 additions and 38 deletions

37
.github/workflows/playwright.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: E2E Tests
on:
workflow_call:
jobs:
build:
name: Run E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Docker Compose
run: sudo apt-get update && sudo apt-get install -y docker-compose
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Build Formbricks Image & Run
run: docker-compose up -d
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

View File

@@ -27,8 +27,13 @@ jobs:
uses: ./.github/workflows/build-web.yml
secrets: inherit
e2e-test:
name: Run E2E Tests
uses: ./.github/workflows/playwright.yml
secrets: inherit
required:
needs: [lint, test, build]
needs: [lint, test, build, e2e-test]
if: always()
runs-on: ubuntu-latest
steps: