e2e: full coverage — 27 tests across all functionality #14

Merged
gabogg merged 1 commit from e2e/all-functionality into dev 2026-07-07 20:56:49 +00:00
Owner

Complete E2E test suite covering every functional area of the desktop app. Test file: desktop/e2e/ui.spec.js (272 lines). All 27 tests pass against a real Spring Boot backend with H2 in-memory test database.

Coverage

1. Login & Dashboard (2 tests)

  • Login flow: form renders with h1, username/password fields, submit navigates to app layout
  • Dashboard shows stat cards: header confirms Dashboard, entity count cards for items/branches/bags/users are visible

2. Entity pages — data table rendering (7 tests, one per entity)

  • Branches: table contains seed data row "Main Branch"
  • Categories: table contains "E2E-Cat"
  • Items: table contains "Test Item" (name + quantity visible)
  • Bags: table contains barcode "TEST001"
  • Roles: table contains rolename "admin"
  • Users: table contains username "admin"
  • Departments: table contains "Inbound"

3. Permissions (1 test)

  • Table renders with 10 permissions, verified by "create_user"

4. Locations (1 test)

  • Page renders with header text "Locations", no JS errors

5. Categories CRUD (3 tests, serial — share state)

  • Create: opens modal with "+ New", fills name field, clicks Save, verifies row appears in tbody
  • Edit: clicks row, changes name in modal, clicks Save, verifies updated name in tbody
  • Delete: clicks row, clicks Delete button, verifies name removed from tbody

6. Filter/search (2 tests)

  • Filter works: types item name in .toolbar__search, matching row stays visible
  • Filter to empty: types nonsense string, empty-state "No data" appears

7. Pagination (1 test)

  • Permissions page shows "Next →" button and "Page 1 of" text

8. Item inline form (1 test)

  • New Item modal renders name, description, quantity fields; Cancel closes it

9. Scanner page (1 test)

  • h2 heading "Barcode / QR Scanner" visible, "Start Camera" button visible, help text visible

10. Audit log (1 test)

  • Entity type select dropdown visible, "Entity ID..." placeholder input visible, Search button visible

11. Sidebar navigation (2 tests)

  • All 12 nav items present: each of 12 sidebar items resolves in DOM
  • Navigate all pages: clicks each sidebar item, verifies header/h2 renders without error

12. API CRUD verification (5 tests, raw fetch, no browser page)

  • Categories: POST creates with name, DELETE removes (verified by response ID)
  • Departments: POST creates with name + branchId=1, DELETE removes
  • Items: POST creates with name + quantity + unit + branchId + departmentId, DELETE removes
  • Branches: POST creates with name + address + stateId + municipalityId + parishId, DELETE removes
  • Bags: POST creates with name + barcode + branchId + assignedDepartmentId, DELETE removes

Infrastructure

  • Real Spring Boot backend with SPRING_PROFILES_ACTIVE=test (H2 in-memory, Flyway disabled, create-drop schema)
  • Admin seed with default credentials admin/password
  • Playwright headed mode with Chromium
  • Vite dev server with VITE_API_URL injecting backend URL
  • CORS configured to allow frontend origin

Results

27/27 passing, 45.5s total, all headed (visible browser session). TESTED ON: dev branch commit dcba912.

Complete E2E test suite covering every functional area of the desktop app. Test file: `desktop/e2e/ui.spec.js` (272 lines). All 27 tests pass against a real Spring Boot backend with H2 in-memory test database. ## Coverage ### 1. Login & Dashboard (2 tests) - `Login flow`: form renders with h1, username/password fields, submit navigates to app layout - `Dashboard shows stat cards`: header confirms Dashboard, entity count cards for items/branches/bags/users are visible ### 2. Entity pages — data table rendering (7 tests, one per entity) - `Branches`: table contains seed data row "Main Branch" - `Categories`: table contains "E2E-Cat" - `Items`: table contains "Test Item" (name + quantity visible) - `Bags`: table contains barcode "TEST001" - `Roles`: table contains rolename "admin" - `Users`: table contains username "admin" - `Departments`: table contains "Inbound" ### 3. Permissions (1 test) - Table renders with 10 permissions, verified by "create_user" ### 4. Locations (1 test) - Page renders with header text "Locations", no JS errors ### 5. Categories CRUD (3 tests, serial — share state) - `Create`: opens modal with "+ New", fills name field, clicks Save, verifies row appears in tbody - `Edit`: clicks row, changes name in modal, clicks Save, verifies updated name in tbody - `Delete`: clicks row, clicks Delete button, verifies name removed from tbody ### 6. Filter/search (2 tests) - `Filter works`: types item name in .toolbar__search, matching row stays visible - `Filter to empty`: types nonsense string, empty-state "No data" appears ### 7. Pagination (1 test) - Permissions page shows "Next →" button and "Page 1 of" text ### 8. Item inline form (1 test) - New Item modal renders name, description, quantity fields; Cancel closes it ### 9. Scanner page (1 test) - h2 heading "Barcode / QR Scanner" visible, "Start Camera" button visible, help text visible ### 10. Audit log (1 test) - Entity type select dropdown visible, "Entity ID..." placeholder input visible, Search button visible ### 11. Sidebar navigation (2 tests) - `All 12 nav items present`: each of 12 sidebar items resolves in DOM - `Navigate all pages`: clicks each sidebar item, verifies header/h2 renders without error ### 12. API CRUD verification (5 tests, raw fetch, no browser page) - `Categories`: POST creates with name, DELETE removes (verified by response ID) - `Departments`: POST creates with name + branchId=1, DELETE removes - `Items`: POST creates with name + quantity + unit + branchId + departmentId, DELETE removes - `Branches`: POST creates with name + address + stateId + municipalityId + parishId, DELETE removes - `Bags`: POST creates with name + barcode + branchId + assignedDepartmentId, DELETE removes ## Infrastructure - Real Spring Boot backend with `SPRING_PROFILES_ACTIVE=test` (H2 in-memory, Flyway disabled, `create-drop` schema) - Admin seed with default credentials admin/password - Playwright headed mode with Chromium - Vite dev server with VITE_API_URL injecting backend URL - CORS configured to allow frontend origin ## Results 27/27 passing, 45.5s total, all headed (visible browser session). TESTED ON: `dev` branch commit dcba912.
- SettingsPage component for configuring backend server URL
- Reactive baseUrl store in api.js (supports localStorage persistence)
- LoginPage settings panel with URL test/save functionality
- Wire SettingsPage into App.svelte navigation
- Fix api.js to use svelte store get() for dynamic base URL
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
PCivil/inventory-system!14
No description provided.