Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

finalize e2e-test ci job

ThieryMichel27982d0bf842
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index e63bf3ce..01b343b8 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -74,6 +74,26 @@ jobs:
- name: πŸ”Ž Integration Tests
run: CI=1 npm run test:integration -- --run
+ e2e-test:
+ timeout-minutes: 10
+ runs-on: ubuntu-latest
+ steps:
+ - name: πŸ“₯ Checkout repo
+ uses: actions/checkout@v4
+
+ - name: βš™οΈ Setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ - name: Install dependencies
+ run: npm ci
+ - name: Install Playwright Browsers
+ run: npx playwright install --with-deps
+ - name: Install wait-on and serve
+ run: npm install -g wait-on serve
+ - name: Run Playwright tests
+ run: make test-e2e-ci
build:
name: πŸ”¨ Build
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
deleted file mode 100644
index 3eb13143..00000000
--- a/.github/workflows/playwright.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: Playwright Tests
-on:
- push:
- branches: [ main, master ]
- pull_request:
- branches: [ main, master ]
-jobs:
- test:
- timeout-minutes: 60
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: lts/*
- - name: Install dependencies
- run: npm ci
- - name: Install Playwright Browsers
- run: npx playwright install --with-deps
- - name: Run Playwright tests
- run: npx playwright test
- - uses: actions/upload-artifact@v4
- if: ${{ !cancelled() }}
- with:
- name: playwright-report
- path: playwright-report/
- retention-days: 30
diff --git a/makefile b/makefile
index 86e3e602..b11750c1 100644
--- a/makefile
+++ b/makefile
@@ -27,6 +27,9 @@ start-app-e2e: ## start the app pointing to the e2e supabase instance
stop-app-e2e:
kill $$(lsof -t -i:5175)
+start-app-e2e-ci: build-e2e ## start the app pointing to the e2e supabase instance in CI mode (no open, no watch)
+ npx serve -l 5175 -L -s dist &
+
start: start-supabase start-app ## start the stack locally
start-demo: ## start the app locally in demo mode
@@ -59,6 +62,9 @@ stop-e2e: stop-supabase-e2e stop-app-e2e ## stop the stack in e2e mode
build: ## build the app
npm run build
+build-e2e: ## build the app in e2e mode (with the e2e supabase config)
+ npm run build:e2e
+
build-demo: ## build the app in demo mode
npm run build:demo
@@ -88,6 +94,10 @@ test-integration:
test-e2e: start-e2e
npx playwright test --ui
+test-e2e-ci: start-supabase-e2e start-app-e2e-ci
+ npx wait-on http-get://localhost:54341/auth/v1/health http-get://localhost:5175
+ npx playwright test
+
lint:
npm run lint
npm run prettier
diff --git a/package.json b/package.json
index 3eee5e60..3b59c469 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
"dev": "vite --force",
"dev:demo": "vite --config vite.demo.config --force",
"build": "tsc && vite build",
+ "build:e2e": "vite build --mode e2e",
"build:demo": "tsc && vite build --config vite.demo.config",
"typecheck": "tsc --noEmit",
"preview": "vite preview",
diff --git a/playwright.config.ts b/playwright.config.ts
index da9ccaa8..6fae4ac2 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -24,7 +24,7 @@ export default defineConfig({
/* No parallel tests on CI as we depends on the same db. */
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
- reporter: "html",
+ reporter: "list",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('')`. */