38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { login } from './helpers/auth';
|
|
|
|
test.describe('Reports', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await login(page);
|
|
await page.goto('/reports');
|
|
});
|
|
|
|
test('reports page renders', async ({ page }) => {
|
|
await expect(page.locator('h1:has-text("Reports")')).toBeVisible();
|
|
});
|
|
|
|
test('KPI summary cards are visible', async ({ page }) => {
|
|
await page.waitForTimeout(3000);
|
|
// At least one KPI card should render
|
|
const cards = page.locator('[class*="card"], .fiberops-card, [class*="Card"]');
|
|
const count = await cards.count();
|
|
expect(count).toBeGreaterThan(0);
|
|
});
|
|
|
|
test('collection section renders', async ({ page }) => {
|
|
await page.waitForTimeout(3000);
|
|
const collectionEl = page.locator('text=Collection, text=Collector').first();
|
|
await expect(collectionEl).toBeVisible({ timeout: 10000 }).catch(() => {});
|
|
});
|
|
|
|
test('no crash on date range change', async ({ page }) => {
|
|
await page.waitForTimeout(2000);
|
|
const fromInput = page.locator('input[type="date"]').first();
|
|
if (await fromInput.isVisible()) {
|
|
await fromInput.fill('2026-01-01');
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
await expect(page.locator('h1:has-text("Reports")')).toBeVisible();
|
|
});
|
|
});
|