Files
plantillas-proyectos/frontend/e2e/modules.spec.ts
Kevin_Ramirez bdd089954b
Some checks failed
Build Producción & Push a Harbor / test (push) Failing after 3s
Build Producción & Push a Harbor / build (push) Has been skipped
Aduanasoft/plantillas-proyectos/pipeline/head There was a failure building this commit
feat: plantilla base workspace SaaS
2026-07-21 13:59:00 -05:00

108 lines
3.7 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Modulos', () => {
test.describe('Import Invoices', () => {
test('factura TEM carga sin error', async ({ page }) => {
await page.goto('/dashboard/invoices?operation_type=imp&invoice_type=TEM')
await expect(page).toHaveURL(/invoices/)
await expect(page.locator('main')).toBeVisible()
})
test('factura DEF carga sin error', async ({ page }) => {
await page.goto('/dashboard/invoices?operation_type=imp&invoice_type=DEF')
await expect(page).toHaveURL(/invoices/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Export Invoices', () => {
test('exportacion carga sin error', async ({ page }) => {
await page.goto('/dashboard/invoices?operation_type=exp')
await expect(page).toHaveURL(/invoices/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Fixed Catalogs', () => {
test('carga sin error', async ({ page }) => {
await page.goto('/dashboard/reference_data/code_pedimento_regimens')
await expect(page).toHaveURL(/reference_data/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('General Catalogs', () => {
test('company information carga sin error', async ({ page }) => {
await page.goto('/dashboard/general_catalogs/company_information')
await expect(page).toHaveURL(/company_information/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Transportes', () => {
test('transporters carga sin error', async ({ page }) => {
await page.goto('/dashboard/general_catalogs/transporters')
await expect(page).toHaveURL(/transporters/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Goods', () => {
test('fixed asset classes carga sin error', async ({ page }) => {
await page.goto('/dashboard/goods/fixed-asset-classes')
await expect(page).toHaveURL(/goods/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Settings', () => {
test('general carga sin error', async ({ page }) => {
await page.goto('/dashboard/settings/general')
await expect(page).toHaveURL(/settings/)
await expect(page.locator('body')).toBeVisible()
})
})
test.describe('Reportes', () => {
test('invoices carga sin error', async ({ page }) => {
await page.goto('/dashboard/reports/invoices')
await expect(page).toHaveURL(/reports/)
await expect(page.locator('main')).toBeVisible()
})
})
test.describe('Logout', () => {
test('cerrar sesion redirige a login', async ({ page }) => {
await page.goto('/dashboard')
await page.waitForLoadState('networkidle')
// Abrir el dropdown del usuario; el trigger es un Sidebar.MenuButton que
// puede no responder al click central → forzar con teclado.
const userBtn = page.getByRole('button').filter({ hasText: '@' }).first()
await userBtn.focus()
await page.keyboard.press('Enter')
// El menú está parcialmente en inglés ("Log out").
await page.getByRole('menuitem', { name: /Log out|Cerrar sesión/i }).click({ timeout: 10000 })
await expect(page).toHaveURL(/(login|workspace\.aduanasoft\.com)/, { timeout: 15000 })
})
})
})