import { test, expect } from '@playwright/test'; import { login } from './helpers/auth'; test.describe('Payments', () => { test.beforeEach(async ({ page }) => { await login(page); await page.goto('/payments'); }); test('payments page renders', async ({ page }) => { await expect(page.locator('h1:has-text("Payments")')).toBeVisible(); await expect(page.locator('table')).toBeVisible(); }); test('payments load with amounts', async ({ page }) => { await page.waitForSelector('tbody tr', { timeout: 15000 }); const rows = page.locator('tbody tr'); const count = await rows.count(); expect(count).toBeGreaterThan(0); }); test('channel filter buttons work', async ({ page }) => { const cashBtn = page.locator('button:has-text("CASH")').first(); await cashBtn.click(); await page.waitForTimeout(500); await expect(page.locator('h1:has-text("Payments")')).toBeVisible(); // All filter works await page.locator('button:has-text("All")').click(); }); test('clicking payment row opens detail modal', async ({ page }) => { await page.waitForSelector('tbody tr', { timeout: 15000 }); await page.locator('tbody tr').first().click(); await page.waitForTimeout(300); await expect(page.locator('text=Payment Details')).toBeVisible(); }); });