mirror of
https://github.com/chatwoot/chatwoot.git
synced 2026-06-04 21:02:35 +08:00
## Description Adds Playwright E2E testing infrastructure with project configuration and a login flow test. This is Phase 1 of the Playwright E2E suite, kept minimal with only the core setup and login component. Ref: Discussion #13500, PR #13067 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Verified all imports resolve correctly (`login-flow-ui-validation.spec.ts` only imports `Login` from `@components/ui`) - Ran login flow test locally against a running Chatwoot instance ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works --------- Co-authored-by: Sony Mathew <sony@chatwoot.com> Co-authored-by: Sony Mathew <2040199+sony-mathew@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| components/ui | ||
| tests/e2e/ui | ||
| .env.example | ||
| .gitignore | ||
| DOCS.md | ||
| eslint.config.mjs | ||
| package.json | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
Chatwoot E2E Testing
End-to-end testing framework for Chatwoot using Component Object Model pattern.
Setup
# Install dependencies
pnpm install
# Install Playwright browsers
npx playwright install
# Configure environment
cp .env.example .env
Edit .env with your Chatwoot instance URL and credentials.
Usage
# Run all tests
pnpm run playwright:run
# Run tests in UI mode
pnpm run playwright:open
# Lint tests and page objects
pnpm run lint
# Generate test code
pnpm run playwright:codegen
Project Structure
tests/playwright/
├── components/
│ ├── api/ # API interaction components
│ └── ui/ # UI page objects
├── tests/
│ └── e2e/
│ ├── api/ # Pure API tests
│ └── ui/ # UI tests
├── utils/ # Shared utilities and helpers
├── response-schemas/ # API response schemas for validation
├── fixtures/ # Test fixtures
└── helpers/ # Helper functions
Documentation
See DOCS.md for complete testing guide including patterns, conventions, and troubleshooting.
Configuration
See .env.example for the full list of variables.