129991cfb7
FASE 3 - Frontend (22 paginas): - Leads (listado, detalle, nuevo), Cotizaciones, Arqueo - Cursos, Alumnos, Empresas (listado, detalle, ventas) - Reportes (ventas, ventas-empresas, reimpresion) - Autorizador, Contacto FASE 4 - Contenedores: - docker-compose.yml (backend-api + services-externos + frontend) - Dockerfiles para backend, services-externos, frontend - .env.example con secretos FASE 5 - Pruebas E2E: - Playwright config + 3 spec files (login, leads, dashboard) - 7 escenarios: login, error, sidebar, crear lead, dashboard cards, timeout, reportes
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test('login exitoso redirige a dashboard', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.fill('[name="rut"]', '12345678-5');
|
|
await page.fill('[name="clave"]', 'password');
|
|
await page.click('button:has-text("Ingresar")');
|
|
await expect(page).toHaveURL(/\/dashboard/);
|
|
});
|
|
|
|
test('login fallido muestra error', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.fill('[name="rut"]', '1-9');
|
|
await page.fill('[name="clave"]', 'invalida');
|
|
await page.click('button:has-text("Ingresar")');
|
|
await expect(page.locator('.alert-danger')).toBeVisible();
|
|
});
|
|
|
|
test('sidebar navegacion funciona', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.fill('[name="rut"]', '12345678-5');
|
|
await page.fill('[name="clave"]', 'password');
|
|
await page.click('button:has-text("Ingresar")');
|
|
await page.click('text=Leads');
|
|
await expect(page).toHaveURL(/\/leads/);
|
|
await page.click('text=Cursos');
|
|
await expect(page).toHaveURL(/\/cursos/);
|
|
});
|