feat: Add Playwright E2E test suite + fix backend rate limiting bug#754
feat: Add Playwright E2E test suite + fix backend rate limiting bug#754devin-ai-integration[bot] wants to merge 4 commits into
Conversation
- Added 'dotenv' dependency to load .env configuration - Rate limit increased to 1000 requests/15min in development mode - Prevents test failures due to restrictive rate limiting
23 tests covering: - Login flow (5 tests): valid/invalid credentials, button states, persistence - Client management (4 tests): create, edit, delete, empty state - Work entry lifecycle (4 tests): create, verify, edit hours, delete - Reporting (3 tests): correct totals, individual entries, empty state - Edge cases (7 tests): empty forms, special chars, long text, validation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Added ensureClientExists, openWorkEntryDialog, createWorkEntry helpers - Refactored work-entries, reports, and edge-cases tests to use shared helpers - Reduces code duplication flagged by SonarCloud quality gate
| await page.goto('/clients'); | ||
| await page.getByRole('button', { name: 'Add Client' }).waitFor({ timeout: 5000 }); | ||
| const tableText = await page.locator('table').textContent().catch(() => ''); | ||
| if (tableText?.includes('No clients found')) { |
There was a problem hiding this comment.
🟡 ensureClientExists checks for any client instead of the specific named client
The ensureClientExists helper at e2e/helpers.ts:29 checks tableText?.includes('No clients found') — it only creates the named client when zero clients exist. If the table already has other clients but not the one requested by name, the function silently skips creation. This breaks downstream callers like createWorkEntry (e2e/helpers.ts:46) which filters the dropdown by clientName via .filter({ hasText: clientName }). For example, e2e/03-work-entries.spec.ts:28 calls createWorkEntry(page, 'Work Entry Test Client', ...) after ensureClientExists(page, 'Work Entry Test Client') — if the database has leftover clients from other tests but not 'Work Entry Test Client', the ensureClientExists check passes (some clients exist), but createWorkEntry fails because the specific option isn't in the dropdown. The check should be !tableText?.includes(name) instead of tableText?.includes('No clients found').
| if (tableText?.includes('No clients found')) { | |
| if (!tableText?.includes(name)) { |
Was this helpful? React with 👍 or 👎 to provide feedback.
- Added fillAndSubmitClientForm helper for inline client creation - Added selectClientAndFillHours local helper in edge cases - Unified client name 'Validation Client' across edge case tests
|
❌ The last analysis has failed. |
|



Summary
Adds a comprehensive Playwright E2E test suite (23 tests across 5 spec files) covering all core user workflows, plus fixes two backend bugs discovered during testing.
Tests added:
Bug fixes:
.envfile (missingdotenvdependency), soNODE_ENVwas alwaysundefinedNODE_ENV=developmentReview & Testing Checklist for Human
npx playwright testfrom the repo root with backend and frontend running to verify all 23 tests passdotenvaddition inbackend/src/server.jsdoesn't conflict with any existing env loading mechanismNotes
webServerentries to auto-start backend/frontend if not already runningLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/9486b6bc87c2455da954d5a4f822be4a