Refactor and migrate Playwright E2E tests:
- Remove `playwright.config.js` to clean up configuration. - Add new E2E test suites (`admin-pos-orders`, `admin-module-goals`, `admin-module-pos-mobile-order-flow`) to structure Admin module tests. - Introduce reusable authentication and data seeding utilities in `fixtures` for streamlined test flows and maintainability.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import {
|
||||
loginAsOperator,
|
||||
bookingTestData,
|
||||
} from './fixtures';
|
||||
|
||||
test.describe('Admin POS Orders', () => {
|
||||
test('loads orders list', async ({ page }) => {
|
||||
await loginAsOperator(page);
|
||||
const deptId = bookingTestData.departmentId.toString();
|
||||
await page.goto(`/admin/${deptId}/modules/pos/orders`);
|
||||
await expect(page).toHaveURL(new RegExp(`/admin/${deptId}/modules/pos/orders`));
|
||||
await expect(page.locator('table')).toBeVisible();
|
||||
});
|
||||
|
||||
test('loads order detail', async ({ page }) => {
|
||||
await loginAsOperator(page);
|
||||
const deptId = bookingTestData.departmentId.toString();
|
||||
await page.goto(`/admin/${deptId}/modules/pos/orders/1`);
|
||||
await expect(page).toHaveURL(new RegExp(`/admin/${deptId}/modules/pos/orders/1`));
|
||||
await expect(page.locator('.order-items')).toBeVisible(); // adjust selector
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user