Skip to content

Commit 59f9541

Browse files
Copilotmgierschdev
andcommitted
Add CI integration and update documentation for E2E tests
Co-authored-by: mgierschdev <62764972+mgierschdev@users.noreply.github.com>
1 parent 47d0843 commit 59f9541

3 files changed

Lines changed: 130 additions & 2 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: E2E QA Validation
2+
3+
on:
4+
push:
5+
branches: [ main, develop, 'copilot/**' ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch: # Allow manual triggering
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
e2e-tests:
15+
name: End-to-End QA Validation
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
permissions:
20+
contents: read
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
# Set up Java for backend
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '17'
30+
distribution: 'temurin'
31+
cache: 'gradle'
32+
33+
# Set up Node.js for frontend and tests
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '18'
38+
cache: 'npm'
39+
cache-dependency-path: |
40+
frontend/package-lock.json
41+
e2e-tests/package.json
42+
43+
# Grant execute permissions
44+
- name: Grant execute permission for gradlew
45+
run: chmod +x backend/gradlew
46+
47+
# Install frontend dependencies (required by E2E test)
48+
- name: Install frontend dependencies
49+
run: |
50+
cd frontend
51+
npm ci
52+
53+
# Install E2E test dependencies
54+
- name: Install E2E test dependencies
55+
run: |
56+
cd e2e-tests
57+
npm ci
58+
59+
# Install Playwright browsers
60+
- name: Install Playwright Chromium
61+
run: |
62+
cd e2e-tests
63+
npx playwright install chromium
64+
65+
# Run E2E tests
66+
- name: Run E2E QA validation tests
67+
run: |
68+
cd e2e-tests
69+
npm test
70+
71+
# Upload screenshots on failure or success
72+
- name: Upload screenshots
73+
if: always()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: e2e-screenshots
77+
path: /tmp/qa-screenshot-*.png
78+
if-no-files-found: warn
79+
80+
# Upload test logs on failure
81+
- name: Upload logs on failure
82+
if: failure()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: e2e-logs
86+
path: e2e-tests/*.log
87+
if-no-files-found: ignore

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.idea
1+
.idea
2+
e2e-tests/node_modules/
3+
e2e-tests/package-lock.json

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ make test # Run all tests
7777
make docker-up # Start with Docker
7878
```
7979

80+
### Validate Installation
81+
82+
Run end-to-end tests to verify everything works:
83+
84+
```bash
85+
cd e2e-tests
86+
npm install
87+
npx playwright install chromium
88+
npm test
89+
```
90+
91+
This will start both services, run comprehensive tests, and generate a report.
92+
8093
## Architecture at a Glance
8194

8295
```mermaid
@@ -300,9 +313,35 @@ npm test
300313

301314
**Philosophy**: Focus on component behavior and rendering. API calls are tested in integration tests.
302315

316+
### End-to-End Tests
317+
318+
**Location**: `e2e-tests/`
319+
320+
**Coverage**:
321+
-**Application Boot** - Backend and frontend startup validation
322+
-**Game Initialization** - Board setup and initial state
323+
-**Legal Moves** - Basic move validation (e2-e4, e7-e5)
324+
-**Illegal Move Rejection** - Move validation and error handling
325+
-**Special Rules** - Valid moves API, pawn promotion, castling, en passant
326+
-**Check and Checkmate** - Fool's Mate detection
327+
-**Non-Goals Validation** - Documented limitations verification
328+
-**API Validation** - All REST endpoints
329+
-**Security Posture** - Authentication, secrets, CORS
330+
331+
**Run Tests**:
332+
```bash
333+
cd e2e-tests
334+
npm install
335+
npx playwright install chromium
336+
npm test
337+
```
338+
339+
**Philosophy**: Black box testing from a real user's perspective. Uses only public interfaces (HTTP API and browser UI). Tests behavior, not implementation.
340+
341+
**CI Integration**: E2E tests run automatically on push via GitHub Actions workflow.
342+
303343
### What's Intentionally Missing
304344

305-
- **E2E Tests**: No Playwright/Cypress tests (frontend + backend integration tested manually)
306345
- **Performance Tests**: No load testing (not a production service)
307346
- **Security Tests**: No penetration testing (local HTTP only)
308347

0 commit comments

Comments
 (0)