Files
calendar/.gitea/workflows/integration-tests.yml
Connor Johnstone 7d00a2dadb
Some checks failed
Integration Tests / e2e-tests (push) Failing after 4s
Integration Tests / unit-tests (push) Failing after 1m1s
Implement comprehensive frontend integration testing with Playwright
- Add Playwright E2E testing framework with cross-browser support (Chrome, Firefox)
- Create authentication helpers for CalDAV server integration
- Implement calendar interaction helpers with event creation, drag-and-drop, and view switching
- Add comprehensive drag-and-drop test suite with event cleanup
- Configure CI/CD integration with Gitea Actions for headless testing
- Support both local development and CI environments with proper dependency management
- Include video recording, screenshots, and HTML reporting for test debugging
- Handle Firefox-specific timing and interaction challenges with force clicks and timeouts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 11:54:40 -04:00

133 lines
3.1 KiB
YAML

name: Integration Tests
on:
push:
branches: [ main, feature/integration-testing ]
pull_request:
branches: [ main ]
jobs:
e2e-tests:
runs-on: ubuntu-latest
services:
# Backend service for testing
backend:
image: ubuntu-latest
ports:
- 3000:3000
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: frontend/e2e/package-lock.json
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
version: 'latest'
- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Build backend
run: |
cd backend
cargo build --release
- name: Build frontend
run: |
trunk build --release
- name: Install E2E test dependencies
run: |
cd frontend/e2e
npm ci
npx playwright install chromium firefox
# Install system dependencies for Ubuntu runner
sudo apt-get update && sudo apt-get install -y \
libnss3 libatk-bridge2.0-0 libdrm2 libgtk-3-0 \
libgbm1 libasound2
- name: Start backend server
run: |
cd backend
cargo run --release &
# Wait for server to start
sleep 10
curl -f http://localhost:3000/health || exit 1
env:
CI: true
- name: Start frontend server
run: |
trunk serve --release --address 0.0.0.0 &
# Wait for frontend to start
sleep 10
curl -f http://localhost:8080 || exit 1
env:
CI: true
- name: Run E2E tests
run: |
cd frontend/e2e
npx playwright test --project=chromium --project=firefox
env:
CI: true
TEST_CALDAV_SERVER: https://baikal.rcjohnstone.com/dav.php/
TEST_CALDAV_USERNAME: test
TEST_CALDAV_PASSWORD: I0W?7`|Cs6tA`s
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: frontend/e2e/playwright-report/
retention-days: 30
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run frontend unit tests
run: |
cd frontend
wasm-pack test --headless --chrome --firefox
- name: Run backend unit tests
run: |
cd backend
cargo test
- name: Run calendar-models tests
run: |
cd calendar-models
cargo test --features wasm