aps-agent/apps/web/e2e/guest-smoke.spec.ts

30 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ============================================================
// 访客冒烟(矩阵 118 · 前端 E2E)—— 离线可跑,不依赖后端/JMS
// 断言登录入口、登录弹窗字段与中文界面文案
// ============================================================
import { test, expect } from '@playwright/test';
test.describe('访客冒烟(离线)', () => {
test('打开应用出现中文品牌与登录入口', async ({ page }) => {
await page.goto('/');
await expect(page.locator('.sidebar-brand')).toContainText('工业智核');
const trigger = page.locator('.guest-login-trigger');
await expect(trigger).toBeEnabled({ timeout: 30_000 });
await expect(trigger).toContainText('登录');
});
test('登录弹窗字段齐全(企业/账号/密码)且 Esc 可关闭', async ({ page }) => {
await page.goto('/');
const trigger = page.locator('.guest-login-trigger');
await expect(trigger).toBeEnabled({ timeout: 30_000 });
await trigger.click();
const dialog = page.locator('.auth-login-dialog');
await expect(dialog).toBeVisible();
await expect(dialog.locator('#login-title')).toContainText('登录工业智核');
await expect(dialog.locator('input[placeholder="请输入企业名称"]')).toBeVisible();
await expect(dialog.locator('input[placeholder="请输入用户名"]')).toBeVisible();
await expect(dialog.locator('input[placeholder="请输入密码"]')).toBeVisible();
await page.keyboard.press('Escape');
await expect(dialog).toBeHidden();
});
});