Fix Playwright skipped test route mismatches
This commit is contained in:
@@ -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 }) => {
|
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);
|
const resp = await request.post(
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
`${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(resp.status()).toBeLessThan(500);
|
||||||
expect([400, 401, 403, 404, 422].includes(resp.status())).toBeTruthy();
|
expect([400, 401, 403, 404, 422].includes(resp.status())).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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 }) => {
|
test('[V25-EMP-DOC-003] EMP-DOC-003 Executable upload to employee documents is blocked', async ({ page }) => {
|
||||||
skipIfMissing('EMPLOYEE_A_ID');
|
skipIfMissing('EMPLOYEE_A_ID');
|
||||||
await login(page, 'Firm Admin');
|
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);
|
await expectNoBackendError(page);
|
||||||
const fileInput = page.locator('input[type="file"]').first();
|
const fileInput = page.locator('input[type="file"][name="document_file"], input[type="file"]').first();
|
||||||
if (!(await fileInput.count())) test.skip(true, 'No file input on employee detail page');
|
expect(await fileInput.count(), 'Employee document upload input should be present on /employees/documents').toBeGreaterThan(0);
|
||||||
const { uploadPath } = require('../fixtures/v204-helpers');
|
const { uploadPath } = require('../fixtures/v204-helpers');
|
||||||
await fileInput.setInputFiles(uploadPath('not-a-pdf.exe'));
|
await fileInput.setInputFiles(uploadPath('not-a-pdf.exe'));
|
||||||
const submit = page.locator('form:has(input[type="file"]) button[type="submit"]').first();
|
const submit = page.locator('form:has(input[type="file"]) button[type="submit"]').first();
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ test.describe('SVC: Services depth', () => {
|
|||||||
test('[V25-SVC-008] SVC-008 Subscription lock CSRF-less POST is rejected', async ({ request }) => {
|
test('[V25-SVC-008] SVC-008 Subscription lock CSRF-less POST is rejected', async ({ request }) => {
|
||||||
skipIfMissing('SUBSCRIPTION_A_ID');
|
skipIfMissing('SUBSCRIPTION_A_ID');
|
||||||
const resp = await request.post(
|
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: '' } }
|
{ form: { csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
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 }) => {
|
test('[V25-SVC-009] SVC-009 Bulk lock CSRF-less POST is rejected', async ({ request }) => {
|
||||||
const resp = await request.post(
|
const resp = await request.post(
|
||||||
`${BASE_URL}/services/bulk-lock`,
|
`${BASE_URL}/services/engagements/bulk-lock`,
|
||||||
{ form: { csrf_token: '' } }
|
{ form: { csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
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 }) => {
|
test('[V25-SVC-010] SVC-010 Subscription generate CSRF-less POST is rejected', async ({ request }) => {
|
||||||
skipIfMissing('SUBSCRIPTION_A_ID');
|
skipIfMissing('SUBSCRIPTION_A_ID');
|
||||||
const resp = await request.post(
|
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: '' } }
|
{ form: { csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
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 }) => {
|
test('[V25-SVC-013] SVC-013 Task bulk-update CSRF-less POST is rejected', async ({ request }) => {
|
||||||
const resp = await request.post(
|
const resp = await request.post(
|
||||||
`${BASE_URL}/services/tasks/bulk-update`,
|
`${BASE_URL}/services/work-tracker/tasks/bulk-update`,
|
||||||
{ form: { csrf_token: '' } }
|
{ form: { csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
||||||
|
|||||||
@@ -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 }) => {
|
test('[V25-BILL-009] BILL-009 Invoice post CSRF-less POST is rejected', async ({ request }) => {
|
||||||
skipIfMissing('INVOICE_A_ID');
|
skipIfMissing('INVOICE_A_ID');
|
||||||
const resp = await request.post(
|
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: '' } }
|
{ form: { csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
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 }) => {
|
test('[V25-BILL-010] BILL-010 New payment CSRF-less POST is rejected', async ({ request }) => {
|
||||||
skipIfMissing('INVOICE_A_ID');
|
skipIfMissing('INVOICE_A_ID');
|
||||||
const resp = await request.post(
|
const resp = await request.post(
|
||||||
`${BASE_URL}/billing/invoices/${idOr('INVOICE_A_ID')}/payments/new`,
|
`${BASE_URL}/billing/${idOr('INVOICE_A_ID')}/payments/new`,
|
||||||
{ form: { amount: '1000', csrf_token: '' } }
|
{ form: { payment_date: '2026-06-27', amount_received: '1000', csrf_token: '' } }
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
if (!resp || [404, 405].includes(resp.status())) test.skip(true, 'Route not available');
|
||||||
expect([400, 401, 403, 422].includes(resp.status())).toBeTruthy();
|
expect([400, 401, 403, 422].includes(resp.status())).toBeTruthy();
|
||||||
|
|||||||
Reference in New Issue
Block a user