Skip to content

Commit eec1702

Browse files
committed
WEB-1037: add client action page objects, seeded factory with state overrides, and ApiSetupManager.getClientTemplate
- Add 5 Layer-2 selector maps (activate/reject/withdraw/reactivate/transfer) - Add 5 client-action Page Objects under playwright/pages/client-actions/ - Extend client factory with ClientState union, CreateTestClientOverrides, and createSeededClient covering pending/active/rejected/withdrawn/closed with FK-safe cleanup deleters - Extend FineractApiClient with getClientTemplate, rejectClient, withdrawClient, ensureClientRejectionReason, ensureClientWithdrawalReason - Add ApiSetupManager.getClientTemplate domain wrapper with 'none' sentinel - Add 15 factory unit tests + 5 getClientTemplate wrapper tests (95 unit tests total, all passing) - Route factories/client.spec.ts through the 'unit' project; keep .factory.spec.ts under 'integration'
1 parent 4493297 commit eec1702

14 files changed

Lines changed: 1495 additions & 50 deletions

playwright.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ export default defineConfig({
131131
// Pure-logic unit tests for shared utilities (retry, sleep, ...).
132132
// No browser, no auth setup, no app dependency.
133133
name: 'unit',
134-
testMatch: /playwright\/utils\/.*\.spec\.ts/,
134+
testMatch: [
135+
/playwright\/utils\/.*\.spec\.ts/,
136+
/playwright\/factories\/client\.spec\.ts/
137+
],
135138
testDir: '.',
136139
use: { storageState: { cookies: [], origins: [] } }
137140
},
@@ -140,7 +143,7 @@ export default defineConfig({
140143
// Runs against `E2E_FINERACT_URL` (default https://localhost:8443)
141144
// and exits in seconds because no Chromium process is started.
142145
name: 'integration',
143-
testMatch: /playwright\/factories\/.*\.spec\.ts/,
146+
testMatch: /playwright\/factories\/.*\.factory\.spec\.ts/,
144147
testDir: '.',
145148
use: { storageState: { cookies: [], origins: [] } }
146149
},

playwright/config/selectors.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,91 @@ export const CLOSE_CLIENT_SELECTORS: CloseClientSelectors = {
294294
confirmButton: 'Confirm',
295295
cancelButton: 'Cancel'
296296
};
297+
298+
// ---------------------------------------------------------------------------
299+
// Activate client action form
300+
// ---------------------------------------------------------------------------
301+
302+
export interface ActivateClientSelectors {
303+
activationDateInput: string;
304+
confirmButton: string;
305+
cancelButton: string;
306+
}
307+
308+
export const ACTIVATE_CLIENT_SELECTORS: ActivateClientSelectors = {
309+
activationDateInput: 'input[formcontrolname="activationDate"]',
310+
confirmButton: 'Confirm',
311+
cancelButton: 'Cancel'
312+
};
313+
314+
// ---------------------------------------------------------------------------
315+
// Reject client action form
316+
// ---------------------------------------------------------------------------
317+
318+
export interface RejectClientSelectors {
319+
rejectionDateInput: string;
320+
rejectionReasonSelect: string;
321+
confirmButton: string;
322+
cancelButton: string;
323+
}
324+
325+
export const REJECT_CLIENT_SELECTORS: RejectClientSelectors = {
326+
rejectionDateInput: 'input[formcontrolname="rejectionDate"]',
327+
rejectionReasonSelect: 'mat-select[formcontrolname="rejectionReasonId"]',
328+
confirmButton: 'Confirm',
329+
cancelButton: 'Cancel'
330+
};
331+
332+
// ---------------------------------------------------------------------------
333+
// Withdraw client action form
334+
// ---------------------------------------------------------------------------
335+
336+
export interface WithdrawClientSelectors {
337+
withdrawalDateInput: string;
338+
withdrawalReasonSelect: string;
339+
confirmButton: string;
340+
cancelButton: string;
341+
}
342+
343+
export const WITHDRAW_CLIENT_SELECTORS: WithdrawClientSelectors = {
344+
withdrawalDateInput: 'input[formcontrolname="withdrawalDate"]',
345+
withdrawalReasonSelect: 'mat-select[formcontrolname="withdrawalReasonId"]',
346+
confirmButton: 'Confirm',
347+
cancelButton: 'Cancel'
348+
};
349+
350+
// ---------------------------------------------------------------------------
351+
// Reactivate client action form
352+
// ---------------------------------------------------------------------------
353+
354+
export interface ReactivateClientSelectors {
355+
reactivationDateInput: string;
356+
confirmButton: string;
357+
cancelButton: string;
358+
}
359+
360+
export const REACTIVATE_CLIENT_SELECTORS: ReactivateClientSelectors = {
361+
reactivationDateInput: 'input[formcontrolname="reactivationDate"]',
362+
confirmButton: 'Confirm',
363+
cancelButton: 'Cancel'
364+
};
365+
366+
// ---------------------------------------------------------------------------
367+
// Transfer client action form
368+
// ---------------------------------------------------------------------------
369+
370+
export interface TransferClientSelectors {
371+
destinationOfficeSelect: string;
372+
transferDateInput: string;
373+
noteInput: string;
374+
confirmButton: string;
375+
cancelButton: string;
376+
}
377+
378+
export const TRANSFER_CLIENT_SELECTORS: TransferClientSelectors = {
379+
destinationOfficeSelect: 'mat-select[formcontrolname="destinationOfficeId"]',
380+
transferDateInput: 'input[formcontrolname="transferDate"]',
381+
noteInput: 'textarea[formcontrolname="note"]',
382+
confirmButton: 'Confirm',
383+
cancelButton: 'Cancel'
384+
};

0 commit comments

Comments
 (0)