import { expect, test } from '@playwright/test'; const username = process.env.TEST_USERNAME; const password = process.env.TEST_PASSWORD; test.beforeEach(async ({ page }) => { test.skip(!username || !password, 'TEST_USERNAME/TEST_PASSWORD not set'); await page.goto('/login'); await page.getByLabel(/username/i).fill(username!); await page.getByLabel(/password/i).fill(password!); await page.getByRole('button', { name: /sign in|log in/i }).click(); await expect(page).toHaveURL(/\/(?!login)/, { timeout: 10_000 }); }); test('repairs page renders and filters by status', async ({ page }) => { await page.goto('/repairs'); await expect(page.getByRole('heading', { name: /repairs/i })).toBeVisible(); const statusFilter = page.getByRole('combobox').first(); if (await statusFilter.count()) { await statusFilter.click(); await page.getByRole('option', { name: /in progress|pending/i }).first().click(); } });