- 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.
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import {
|
|
userCredentials,
|
|
loginAsUser,
|
|
} from './fixtures';
|
|
|
|
/** User invoices Tests */
|
|
|
|
// User invoices page content tests
|
|
test('[PAGES][User][/user/invoices] should load the page', async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto('/user/invoices');
|
|
await expect(page).toHaveURL(/invoices/);
|
|
});
|
|
|
|
test('[PAGES][User][/user/invoices] should display the title', async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto('/user/invoices');
|
|
await expect(page.locator('.title')).toContainText('Oversigt over fakturaer');
|
|
});
|
|
|
|
// Invoices table tests
|
|
test('[PAGES][User][/user/invoices] should display the invoices table', async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto('/user/invoices');
|
|
await expect(page.locator('table.is-fullwidth')).toBeVisible();
|
|
});
|
|
|
|
test('[PAGES][User][/user/invoices] should show empty invoices list', async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto('/user/invoices');
|
|
await expect(page.locator('tbody tr')).toHaveCount(0);
|
|
});
|
|
|
|
test('[PAGES][User][/user/invoices] should display table headers', async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto('/user/invoices');
|
|
await expect(page.locator('thead th')).toHaveCount(6);
|
|
});
|
|
|
|
// TODO: tests for pagination, search, download, details, mobile, etc.
|
|
// ...
|