test(e2e): form-validation regression coverage (PMS-518 AC7) #363

Merged
nrupard merged 2 commits from test/PMS-518-form-validation-e2e into main 2026-06-25 21:49:47 +02:00
Owner

What

Adds the AC7 regression coverage for the PMS-515 form-validation epic: e2e/tests/form-validation.spec.ts under a new browser-driven form-ui Playwright project.

Coverage

Drives the deployed SPA create forms in a real browser (DOM assertions, like auth.spec.ts - the FormGuard validation is client-side and never reaches an API):

  • new-ticket - an empty submit flags every missing required field at once: Title + Description in their own inline slots, Company in the form-level banner; and does not navigate (the guard blocked the POST).
  • new-ticket - correcting one field clears only its error (per-field, not a shared banner).
  • new-contact - an empty submit flags both First/Last name inline; no navigation.

This is exactly AC7: "empty required fields are rejected with per-field errors and valid submissions are unchanged" (the valid-submit path is already covered by the API specs).

Quarantined (test.fixme)

Until BOTH clear:

  1. The target's mokosh-apps SPA includes the PMS-518 FormGuard migration (merged to mokosh-apps main AND staging redeployed). On an older SPA these assertions fail.
  2. The browser-login path is green - the spec shares loginViaSpa, currently blocked by the PMS-148 post-setup login stall (same blocker as auth.spec.ts).

The spec + config compile and list cleanly (npx playwright test --list shows the 3 form-ui tests); it is skipped at runtime via test.fixme so it does not affect the merge gate.

Docs

e2e/README.md (coverage table) and dev-docs/e2e.md (project model + quarantined-specs table) document the new spec, the form-ui project, and the un-fixme conditions.

## What Adds the **AC7 regression coverage** for the PMS-515 form-validation epic: `e2e/tests/form-validation.spec.ts` under a new browser-driven `form-ui` Playwright project. ## Coverage Drives the deployed SPA create forms in a real browser (DOM assertions, like `auth.spec.ts` - the `FormGuard` validation is client-side and never reaches an API): - **new-ticket** - an empty submit flags **every** missing required field at once: Title + Description in their own inline slots, Company in the form-level banner; and does not navigate (the guard blocked the POST). - **new-ticket** - correcting one field clears only its error (per-field, not a shared banner). - **new-contact** - an empty submit flags both First/Last name inline; no navigation. This is exactly AC7: "empty required fields are rejected with per-field errors and valid submissions are unchanged" (the valid-submit path is already covered by the API specs). ## Quarantined (`test.fixme`) Until BOTH clear: 1. The target's mokosh-apps SPA includes the PMS-518 `FormGuard` migration (merged to mokosh-apps `main` AND staging redeployed). On an older SPA these assertions fail. 2. The browser-login path is green - the spec shares `loginViaSpa`, currently blocked by the PMS-148 post-`setup` login stall (same blocker as `auth.spec.ts`). The spec + config compile and list cleanly (`npx playwright test --list` shows the 3 `form-ui` tests); it is skipped at runtime via `test.fixme` so it does not affect the merge gate. ## Docs `e2e/README.md` (coverage table) and `dev-docs/e2e.md` (project model + quarantined-specs table) document the new spec, the `form-ui` project, and the un-fixme conditions.
test(e2e): add form-validation regression coverage (PMS-518 AC7)
Some checks failed
E2E / Playwright against staging (pull_request) Successful in 1m3s
Check / fmt + clippy + build + tests (pull_request) Successful in 3m7s
Integration / integration tests (pull_request) Has been cancelled
729257fab2
Adds tests/form-validation.spec.ts under a new browser-driven `form-ui` Playwright project. It drives the SPA create forms (new-ticket, new-contact) and asserts the PMS-515/518 unified validation behaviour: an empty submit flags EVERY missing required field at once (per-field inline errors, company in the form-level banner) and does not navigate, and correcting one field clears only its error. DOM-only, like auth.spec.ts, because the FormGuard validation is client-side and never reaches an API.

Quarantined as test.fixme until both blockers clear: (1) the target's mokosh-apps SPA must include the PMS-518 FormGuard migration (merged to mokosh-apps main AND staging redeployed - on an older SPA the assertions fail), and (2) the browser-login path must be green (it shares loginViaSpa, currently blocked by the PMS-148 post-setup login stall). The spec + config compile and list cleanly (npx playwright test --list shows the 3 form-ui tests).

Documents the new spec + project in e2e/README.md (coverage table) and dev-docs/e2e.md (project model + quarantined-specs table). This is the AC7 deliverable for the PMS-515 epic.

#PMS-518
test(e2e): fix form-validation spec quarantine + login frugality (review)
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 56s
Check / fmt + clippy + build + tests (pull_request) Successful in 3m24s
Create release / Create release from merged PR (pull_request) Successful in 3s
Integration / integration tests (pull_request) Successful in 11m29s
98378e65c4
Two review fixes to the new form-validation spec:

- Use `test.describe.fixme(...)` instead of `test.describe(...)` with a bare `test.fixme()` in the describe body. The bare call is not the canonical group-skip and would have left the tests runnable - they would have executed against a possibly-old SPA and the PMS-148-blocked login and failed the e2e gate. `describe.fixme` skips the whole group unambiguously.
- Collapse the three per-test cases into one test with a single `loginViaSpa`, instead of a `beforeEach` that logged in per test. The suite is rate-limited to 5 logins/min/email and `setup` + `auth-ui` already spend logins; a login-per-test here would trip the cap once un-fixme'd. The single test still covers new-ticket (report-all + no-nav + correct-one-clears-only-its-error) and new-contact (both names).

Also add `exact: true` to the submit-button role selectors. Verified: `npx playwright test --list` shows the `form-ui` test, and the group is fixme (skipped at runtime).

#PMS-518
nrupard scheduled this pull request to auto merge when all checks succeed 2026-06-25 21:48:03 +02:00
nrupard deleted branch test/PMS-518-form-validation-e2e 2026-06-25 21:49:48 +02:00
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
psa-systems/mokosh-server!363
No description provided.