fix(tests): fix e2e tests, part 2

This commit is contained in:
perf3ct 2025-06-18 21:51:52 +00:00
parent f7c20fa188
commit 5c31710b51
1 changed files with 3 additions and 24 deletions

View File

@ -72,6 +72,8 @@ jobs:
- name: Build backend
run: cargo build --release
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test
- name: Build frontend
working-directory: ./frontend
@ -106,39 +108,16 @@ jobs:
working-directory: ./frontend
run: npx playwright install --with-deps
- name: Start frontend dev server
working-directory: ./frontend
run: |
npm run dev &
echo $! > frontend.pid
env:
VITE_API_URL: http://localhost:8000
- name: Wait for frontend to be ready
run: |
for i in {1..30}; do
if curl -f http://localhost:5173 > /dev/null 2>&1; then
echo "Frontend is ready"
break
fi
echo "Waiting for frontend... ($i/30)"
sleep 2
done
- name: Run frontend E2E tests
working-directory: ./frontend
run: npm run test:e2e
env:
VITE_API_URL: http://localhost:8000
- name: Stop servers
- name: Stop backend server
if: always()
run: |
if [ -f backend.pid ]; then
kill $(cat backend.pid) || true
rm backend.pid
fi
if [ -f frontend.pid ]; then
kill $(cat frontend.pid) || true
rm frontend.pid
fi