Commit 30d56ab
committed
WEB-1019: Add Playwright create-client form-validation spec (PR-3)
- playwright/tests/clients/create-client-form-validation.spec.ts (new)
Pure form-behaviour coverage for the create-client workflow:
1. Empty office → Preview step absent (areFormvalids() false)
2. Empty firstname → ng-invalid + mat-form-field-invalid + mat-error
3. Empty lastname → same as above
4. activationDate < submittedOnDate → matDatepickerMin fires;
ng-invalid + mat-form-field-invalid; Preview absent
5. legalForm PERSON↔ENTITY → name-control subtree swapped;
constitutionId visible in ENTITY, absent in PERSON
Tests use inline credential injection + page.route() mocks for
/clients/template and /fieldconfiguration/ADDRESS so they run
without a live Fineract backend (setup project still needs one).
All 5 tests pass (6 including setup) in ~1 min on Chromium.
- proxy.localhost.conf.js
Fix target: http→https; remove pathRewrite so Fineract receives
the full /fineract-provider/... path that it expects.
- package.json
Add start:local script (serves with proxy.localhost.conf.js)
so the Angular dev-server and the Fineract fixture both target
the same local backend at https://localhost:8443.
- playwright.config.ts
webServer.command: npm run start → npm run start:local so
Playwright's auto-launched dev-server uses the local proxy.
Assertions use ng-invalid / mat-form-field-invalid CSS classes
(Angular Material MDC does not set aria-invalid as an attribute).
mat-checkbox toggle targets the inner input[type=checkbox] directly
to avoid labelPosition=before click-miss issues.1 parent 56252bd commit 30d56ab
4 files changed
Lines changed: 392 additions & 5 deletions
File tree
- playwright/tests/clients
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
0 commit comments