Skip to content

Commit 30d56ab

Browse files
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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"build": "node version.js && npm run env -s && ng build --configuration production --output-hashing=none",
1717
"build:prod": "node version.js && node --max-old-space-size=16384 ./node_modules/@angular/cli/bin/ng build --configuration production --output-hashing=none --base-href=/web-app/",
1818
"start": "npm run env -s && ng serve --proxy-config proxy.conf.js",
19+
"start:local": "npm run env -s && ng serve --proxy-config proxy.localhost.conf.js",
1920
"serve:dev": "npm run env -s && ng serve --source-map",
2021
"serve:sw": "npm run build -s && npx http-server ./dist -p 4200",
2122
"lint": "eslint . && stylelint \"src/**/*.scss\" && prettier . --check && htmlhint \"src\" --config .htmlhintrc",

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default defineConfig({
223223
webServer: process.env.CI
224224
? undefined
225225
: {
226-
command: 'npm run start',
226+
command: 'npm run start:local',
227227
url: 'http://localhost:4200',
228228
reuseExistingServer: true,
229229
timeout: 180000

0 commit comments

Comments
 (0)