test: execute 30 smoke tests + fix P0 CSS break + BREAKS.md report
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Layer 1 break detection results (21/30 pass, 63%):
- SaaS API: 5/5 pass (S3 skip no LLM key)
- Admin V2: 5/6 pass (A6 flaky auth guard)
- Desktop Chat: 3/6 pass (D1 no chat response in browser; D2/D3 skip non-Tauri)
- Desktop Feature: 6/6 pass
- Cross-System: 2/6 pass (4 blocked by login rate limit 429)

Bugs found:
- P0-01: Account lockout not enforced (locked_until set but not checked)
- P1-01: Refresh token still valid after logout
- P1-02: Desktop browser chat no response (stores not exposed)
- P1-03: Provider API requires display_name (undocumented)

Fixes applied:
- desktop/src/index.css: @import -> @plugin for Tailwind v4 compatibility
- Admin tests: correct credentials admin/admin123 from .env
- Cross tests: correct dashboard endpoint /stats/dashboard
This commit is contained in:
iven
2026-04-10 11:26:13 +08:00
parent 2e70e1a3f8
commit 99262efca4
9 changed files with 318 additions and 56 deletions

View File

@@ -18,8 +18,9 @@ test.setTimeout(120000);
// Helper: 等待应用就绪
async function waitForAppReady(page: Page) {
await page.goto('/');
await page.waitForLoadState('networkidle');
await page.waitForSelector('.h-screen', { timeout: 15000 });
// 等待 React 挂载 — 检查 #root 有内容
await page.waitForSelector('#root > *', { timeout: 15000 });
await page.waitForTimeout(1000); // 给 React 额外渲染时间
}
// Helper: 查找聊天输入框

View File

@@ -18,13 +18,17 @@ import { test, expect, type Page } from '@playwright/test';
test.setTimeout(180000);
const SaaS_BASE = 'http://localhost:8080/api/v1';
const ADMIN_USER = 'testadmin';
const ADMIN_PASS = 'Admin123456';
const ADMIN_USER = 'admin';
const ADMIN_PASS = 'admin123';
async function saasLogin(page: Page): Promise<string> {
const res = await page.request.post(`${SaaS_BASE}/auth/login`, {
data: { username: ADMIN_USER, password: ADMIN_PASS },
});
if (!res.ok()) {
const body = await res.text();
console.log(`saasLogin failed: ${res.status()}${body.slice(0, 300)}`);
}
expect(res.ok()).toBeTruthy();
const json = await res.json();
return json.token;
@@ -177,8 +181,8 @@ test('X3: Admin 创建知识条目 → SaaS 搜索可找到', async ({ page }) =
test('X4: Dashboard 统计 — API 验证结构', async ({ page }) => {
const token = await saasLogin(page);
// Step 1: 获取初始统计
const statsRes = await page.request.get(`${SaaS_BASE}/dashboard/stats`, {
// Step 1: 获取初始统计 (correct endpoint: /stats/dashboard)
const statsRes = await page.request.get(`${SaaS_BASE}/stats/dashboard`, {
headers: { Authorization: `Bearer ${token}` },
});
expect(statsRes.ok()).toBeTruthy();

View File

@@ -17,8 +17,8 @@ test.setTimeout(120000);
async function waitForAppReady(page: Page) {
await page.goto('/');
await page.waitForLoadState('networkidle');
await page.waitForSelector('.h-screen', { timeout: 15000 });
await page.waitForSelector('#root > *', { timeout: 15000 });
await page.waitForTimeout(1000);
}
// ── F1: Agent 全生命周期 ──────────────────────────────────────────