Skip to content

Add Playwright E2E test suite#751

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778604914-playwright-tests
Open

Add Playwright E2E test suite#751
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778604914-playwright-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented May 12, 2026

Summary

Adds a comprehensive Playwright E2E test suite covering all major features of the app_timesheet application. The suite includes 18 tests across 6 spec files:

  • Authentication (3 tests): Login page display, login/logout flow, unauthenticated redirect
  • Client Management (4 tests): Table display, dialog open/close, full CRUD, clear all
  • Dashboard (2 tests): Stats/sections display, navigation to other pages
  • Navigation (3 tests): Sidebar items & page navigation, active state highlighting, root redirect
  • Reports (3 tests): Page display, report data with export buttons, empty client message
  • Work Entries (2 tests): Page heading, full CRUD via dialog

Architecture decisions

  • Global auth setup with storageState to share login across tests and stay within the backend's 100 req/15min rate limit
  • API-based test helpers (createClientViaAPI, createWorkEntryViaAPI) for efficient data setup without extra page navigations
  • Unique client names (timestamp-suffixed) to avoid conflicts with shared in-memory database
  • Sidebar-scoped selectors (nav locator) to avoid strict mode violations from duplicate text across sidebar and page content
  • webServer config auto-starts both backend (port 3001) and frontend (port 5173)

Files added

  • playwright.config.ts — Playwright configuration with projects, webServer, and storageState
  • e2e/global-setup.ts — One-time auth setup that saves storageState
  • e2e/helpers.ts — Reusable test utilities (login, API helpers, sidebar selector)
  • e2e/auth.spec.ts, e2e/clients.spec.ts, e2e/dashboard.spec.ts, e2e/navigation.spec.ts, e2e/reports.spec.ts, e2e/work-entries.spec.ts
  • package.json — Added test:e2e, test:e2e:headed, test:e2e:ui scripts
  • .gitignore — Excludes test artifacts and auth state

Review & Testing Checklist for Human

  • Run npm run test:e2e from the project root — all 18 tests should pass (requires backend and frontend to be available or let webServer start them)
  • Verify the tests work in CI by checking that the webServer config correctly starts both servers
  • Review selector strategies — MUI component selectors may need updates if the UI changes significantly

Notes

  • The backend has a global rate limiter (100 req/15min) which constrains the test suite size. The tests use API-based setup and shared auth to stay within this limit.
  • Tests use an in-memory SQLite database, so data does not persist between backend restarts.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/ac263a4f3b814f2186b1933af8337045


Open in Devin Review

- Set up Playwright with TypeScript and Chromium browser
- Configure webServer to auto-start backend (port 3001) and frontend (port 5173)
- Add global auth setup with storageState to minimize login API calls
- Add 18 tests across 6 spec files covering:
  - Authentication: login page, login/logout flow, redirect guards
  - Client Management: table display, dialog open/close, CRUD operations, clear all
  - Dashboard: stats display, sections, navigation to other pages
  - Navigation: sidebar items, page navigation, active states, root redirect
  - Reports: page display, report data with export buttons, empty state
  - Work Entries: page heading, CRUD operations with form dialog
- Add API-based test helpers for efficient setup (createClientViaAPI, createWorkEntryViaAPI)
- Add npm scripts: test:e2e, test:e2e:headed, test:e2e:ui
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10 Security Hotspots

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

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.

0 participants