Skip to content

e2e and i18n in docs#13

Merged
ayahaustine merged 10 commits intomainfrom
dev
May 6, 2026
Merged

e2e and i18n in docs#13
ayahaustine merged 10 commits intomainfrom
dev

Conversation

@ayahaustine
Copy link
Copy Markdown
Owner

@ayahaustine ayahaustine commented May 6, 2026

Summary by CodeRabbit

  • New Features

    • Added comprehensive end-to-end test suite covering authentication flows, login/logout, token refresh, and dashboard access.
  • Chores

    • Introduced automated E2E testing in the CI/CD pipeline.
    • Enhanced development environment with improved containerization and Docker configurations.
    • Expanded project build patterns and ignore rules.

@ayahaustine ayahaustine merged commit 03e54f7 into main May 6, 2026
1 of 5 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b90e2796-02ee-4b08-beac-2a1988b0491e

📥 Commits

Reviewing files that changed from the base of the PR and between 676329f and 229af53.

⛔ Files ignored due to path filters (1)
  • e2e/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (25)
  • .dockerignore
  • .github/workflows/e2e.yml
  • .gitignore
  • Makefile
  • backend/.dockerignore
  • docker-compose.dev.yml
  • docker-compose.yml
  • docs/.dockerignore
  • docs/Dockerfile
  • docs/package.json
  • e2e/.gitignore
  • e2e/package.json
  • e2e/playwright.config.ts
  • e2e/tests/dashboard.spec.ts
  • e2e/tests/global.setup.ts
  • e2e/tests/helpers/api.ts
  • e2e/tests/helpers/fixtures.ts
  • e2e/tests/login.spec.ts
  • e2e/tests/logout.spec.ts
  • e2e/tests/refresh.spec.ts
  • e2e/tests/smoke.spec.ts
  • e2e/tsconfig.json
  • frontend/.dockerignore
  • frontend/Dockerfile
  • frontend/src/lib/api.ts

📝 Walkthrough

Walkthrough

This PR establishes a comprehensive end-to-end testing infrastructure using Playwright, including test suites for authentication flows and health checks. It updates containerization with multi-stage Dockerfiles for development and production, refactors docker-compose configurations, and introduces a GitHub Actions CI workflow to run tests automatically against deployed services.

Changes

End-to-End Testing Infrastructure

Layer / File(s) Summary
Docker Containerization Foundation
.dockerignore, backend/.dockerignore, frontend/.dockerignore, docs/.dockerignore, backend/Dockerfile (implicit), frontend/Dockerfile, docs/Dockerfile
Added .dockerignore files across root, backend, frontend, and docs to exclude build artifacts, caches, and non-essential files. Frontend and docs Dockerfiles now include dev stages exposing ports 3000 and 3001; frontend builder stage accepts NEXT_PUBLIC_API_URL build arg; docs dev stage runs npm start on port 3001.
Docker Compose Development Setup
docker-compose.dev.yml, docker-compose.yml
Refactored docker-compose.dev.yml to use explicit Dockerfile references with dev targets; backend, frontend, and docs services now specify restart policies and expanded environment/volume mounts. Production docker-compose.yml replaces expose directives with explicit port mappings (8000, 3000, 3001) and adds NEXT_PUBLIC_API_URL environment variable.
Playwright Test Framework
e2e/package.json, e2e/tsconfig.json, e2e/playwright.config.ts, e2e/.gitignore
Added e2e package.json with Playwright, TypeScript, and Node type dependencies. Playwright config defines BASE_URL, three projects (setup, chromium, mobile-chrome), tracing/screenshot/video policies, and test directory structure. TypeScript config targets ES2022/CommonJS with strict mode.
Test Helpers & Fixtures
e2e/tests/helpers/api.ts, e2e/tests/helpers/fixtures.ts, e2e/tests/global.setup.ts
Implemented API helper functions (createTestUser, apiLogin, extractCookie) for backend interaction. Fixtures define LoginPage and DashboardPage page-objects, expose authedPage fixture for cookie-based authentication, and configure TEST_USER. Global setup script creates test user before all tests run.
Authentication & Session Test Suites
e2e/tests/login.spec.ts, e2e/tests/logout.spec.ts, e2e/tests/refresh.spec.ts, e2e/tests/dashboard.spec.ts
Comprehensive authentication flow tests covering successful login, token cookie validation (access_token, refresh_token as HTTP-only), error handling for invalid credentials, logout and cookie clearing, refresh token rotation with replay attack prevention, and dashboard access controls with redirect-to-login behavior.
Smoke & Health Tests
e2e/tests/smoke.spec.ts
Smoke tests validating home page load, login/register form rendering, and /api/v1/health endpoint availability.
CI/CD Workflow
.github/workflows/e2e.yml
GitHub Actions workflow triggered on push/PR to main/dev for frontend, backend, e2e, docker-compose, or infra changes. Builds Docker images, starts services, waits for backend health (/api/v1/health) and frontend readiness (curl /), installs e2e dependencies and browsers, runs Playwright tests with TEST_USER env vars, uploads Playwright HTML report and JUnit results, and dumps service logs on failure.
Development Tooling & Configuration
Makefile, .gitignore, frontend/src/lib/api.ts, docs/package.json
Updated Makefile to use docker-compose.dev.yml exclusively for dev and added e2e install/run targets (e2e, e2e-headed, e2e-ui, e2e-report). Expanded .gitignore with backend/.env, backend/.venv, frontend/.env.local, frontend/.next sections. Changed frontend API_BASE default from "http://localhost:8000/api" to "http://localhost/api". Updated docs/package.json name from "." to "docs".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • ayahaustine/modkit#8: Directly related Makefile changes; retrieved PR invokes $(COMPOSE_DEV) which is redefined in this PR.
  • ayahaustine/modkit#9: Frontend API configuration alignment; this PR updates NEXT_PUBLIC_API_URL defaults while retrieved PR modifies .env.example for the same variable.

Poem

🐰 Hop, hop, the tests now flow,
From login's leap to refresh's glow,
Playwright scripts in Docker's embrace,
E2E joy—a testing space!
CI pipelines run day and night,
All authentication shining bright.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant