From 6bf24cf86062d41995470a3d13bf4a61f4f6ad7d Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Sat, 27 Jun 2026 15:24:07 +0530 Subject: [PATCH] Fix Playwright skipped test route mismatches --- tests/consultants-documents.spec.js | 9 +++++++-- tests/employees.spec.js | 6 +++--- tests/noticecases-services-work.spec.js | 8 ++++---- tests/partners-billing.spec.js | 6 +++--- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/consultants-documents.spec.js b/tests/consultants-documents.spec.js index 9a253b1..58cd19c 100644 --- a/tests/consultants-documents.spec.js +++ b/tests/consultants-documents.spec.js @@ -272,8 +272,13 @@ test.describe('DOC-STOR: Document storage and permanent vault', () => { }); test('[V25-DOC-STOR-016] DOC-STOR-016 Storage agent agent-package download requires node auth', async ({ request }) => { - const resp = await request.get(`${BASE_URL}/documents/storage-nodes/download-agent-package`).catch(() => null); - if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); + const resp = await request.post( + `${BASE_URL}/documents/storage-nodes/download-agent-package`, + { form: { node_code: 'UAT-LSA-SEC-A', storage_root_path: 'D:\\AuditFirmStorage', csrf_token: '' } } + ).catch(() => null); + expect(resp, 'Storage agent package route should be available as POST').toBeTruthy(); + expect(resp.status(), 'Storage agent package route should not return 404').not.toBe(404); + expect(resp.status(), 'Storage agent package route should not return 405').not.toBe(405); expect(resp.status()).toBeLessThan(500); expect([400, 401, 403, 404, 422].includes(resp.status())).toBeTruthy(); }); diff --git a/tests/employees.spec.js b/tests/employees.spec.js index ad4d36e..2514280 100644 --- a/tests/employees.spec.js +++ b/tests/employees.spec.js @@ -254,10 +254,10 @@ test.describe('EMP-HR: Employee documents', () => { test('[V25-EMP-DOC-003] EMP-DOC-003 Executable upload to employee documents is blocked', async ({ page }) => { skipIfMissing('EMPLOYEE_A_ID'); await login(page, 'Firm Admin'); - await safeGoto(page, `/employees/${idOr('EMPLOYEE_A_ID')}`); + await safeGoto(page, `/employees/documents?employee_id=${idOr('EMPLOYEE_A_ID')}`); await expectNoBackendError(page); - const fileInput = page.locator('input[type="file"]').first(); - if (!(await fileInput.count())) test.skip(true, 'No file input on employee detail page'); + const fileInput = page.locator('input[type="file"][name="document_file"], input[type="file"]').first(); + expect(await fileInput.count(), 'Employee document upload input should be present on /employees/documents').toBeGreaterThan(0); const { uploadPath } = require('../fixtures/v204-helpers'); await fileInput.setInputFiles(uploadPath('not-a-pdf.exe')); const submit = page.locator('form:has(input[type="file"]) button[type="submit"]').first(); diff --git a/tests/noticecases-services-work.spec.js b/tests/noticecases-services-work.spec.js index e2b5775..7419636 100644 --- a/tests/noticecases-services-work.spec.js +++ b/tests/noticecases-services-work.spec.js @@ -204,7 +204,7 @@ test.describe('SVC: Services depth', () => { test('[V25-SVC-008] SVC-008 Subscription lock CSRF-less POST is rejected', async ({ request }) => { skipIfMissing('SUBSCRIPTION_A_ID'); const resp = await request.post( - `${BASE_URL}/services/${idOr('SUBSCRIPTION_A_ID')}/lock`, + `${BASE_URL}/services/engagements/${idOr('SUBSCRIPTION_A_ID')}/lock`, { form: { csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); @@ -213,7 +213,7 @@ test.describe('SVC: Services depth', () => { test('[V25-SVC-009] SVC-009 Bulk lock CSRF-less POST is rejected', async ({ request }) => { const resp = await request.post( - `${BASE_URL}/services/bulk-lock`, + `${BASE_URL}/services/engagements/bulk-lock`, { form: { csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); @@ -223,7 +223,7 @@ test.describe('SVC: Services depth', () => { test('[V25-SVC-010] SVC-010 Subscription generate CSRF-less POST is rejected', async ({ request }) => { skipIfMissing('SUBSCRIPTION_A_ID'); const resp = await request.post( - `${BASE_URL}/services/subscriptions/${idOr('SUBSCRIPTION_A_ID')}/generate`, + `${BASE_URL}/services/work-tracker/subscriptions/${idOr('SUBSCRIPTION_A_ID')}/generate`, { form: { csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); @@ -246,7 +246,7 @@ test.describe('SVC: Services depth', () => { test('[V25-SVC-013] SVC-013 Task bulk-update CSRF-less POST is rejected', async ({ request }) => { const resp = await request.post( - `${BASE_URL}/services/tasks/bulk-update`, + `${BASE_URL}/services/work-tracker/tasks/bulk-update`, { form: { csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); diff --git a/tests/partners-billing.spec.js b/tests/partners-billing.spec.js index 3813999..3c65f13 100644 --- a/tests/partners-billing.spec.js +++ b/tests/partners-billing.spec.js @@ -170,7 +170,7 @@ test.describe('BILL: Invoices and payments', () => { test('[V25-BILL-009] BILL-009 Invoice post CSRF-less POST is rejected', async ({ request }) => { skipIfMissing('INVOICE_A_ID'); const resp = await request.post( - `${BASE_URL}/billing/invoices/${idOr('INVOICE_A_ID')}/issue`, + `${BASE_URL}/billing/${idOr('INVOICE_A_ID')}/issue`, { form: { csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); @@ -180,8 +180,8 @@ test.describe('BILL: Invoices and payments', () => { test('[V25-BILL-010] BILL-010 New payment CSRF-less POST is rejected', async ({ request }) => { skipIfMissing('INVOICE_A_ID'); const resp = await request.post( - `${BASE_URL}/billing/invoices/${idOr('INVOICE_A_ID')}/payments/new`, - { form: { amount: '1000', csrf_token: '' } } + `${BASE_URL}/billing/${idOr('INVOICE_A_ID')}/payments/new`, + { form: { payment_date: '2026-06-27', amount_received: '1000', csrf_token: '' } } ).catch(() => null); if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available'); expect([400, 401, 403, 422].includes(resp.status())).toBeTruthy();