fix(ECR-001): 对齐 Playwright e2e 与 /psy/ base 及现 UI

E2E 改走 /psy 路径并更新过时文案断言,恢复 L3 冒烟;补充 Phase F QA 报告。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-05 18:34:11 +08:00
co-authored by Cursor
parent e735aa43e3
commit 69fa1b85d6
5 changed files with 78 additions and 16 deletions
+8 -8
View File
@@ -83,24 +83,24 @@ test('star / rhythm / cards pages render with mocked API', async ({ page }) => {
await route.fulfill(ok({}))
})
await page.goto('/star?y=1983&m=6&d=6')
await expect(page.getByRole('heading', { name: '星象性格' })).toBeVisible()
await page.goto('/psy/star?y=1983&m=6&d=6')
await expect(page.getByText('E2E星象')).toBeVisible()
await expect(page.getByRole('button', { name: /深度版/ })).toBeVisible()
await expect(page.getByRole('button', { name: /解锁完整分析/ })).toBeVisible()
await page.goto('/rhythm?y=1992&m=6&d=8')
await expect(page.getByRole('heading', { name: '身心节律' })).toBeVisible()
await page.goto('/psy/rhythm?y=1992&m=6&d=8')
await expect(page.getByText('身心节律').first()).toBeVisible()
await expect(page.getByText('E2E节律')).toBeVisible()
await page.goto('/cards')
await expect(page.getByRole('heading', { name: '意象卡片' })).toBeVisible()
await page.goto('/psy/cards')
await expect(page.getByRole('heading', { name: 'Hi,我是愈心 AI' })).toBeVisible()
await page.getByRole('button', { name: '关联生日' }).click()
await page.locator('input[type="number"]').nth(0).fill('1990')
await page.locator('input[type="number"]').nth(1).fill('5')
await page.locator('input[type="number"]').nth(2).fill('12')
await page.getByRole('button', { name: '抽取卡片' }).click()
await expect(page.getByText('E2E卡片')).toBeVisible()
await page.goto('/companion')
await page.goto('/psy/companion')
await expect(page.getByText('立秋')).toBeVisible()
await expect(page.getByText('今日心情')).toBeVisible()
})
+8 -8
View File
@@ -58,14 +58,14 @@ test('home birth form opens portrait with summary and deep CTA', async ({ page }
})
})
await page.goto('/')
await expect(page.getByRole('img', { name: '愈心谷' }).first()).toBeVisible()
await page.goto('/psy/')
await expect(page.getByRole('navigation', { name: '主导航' })).toBeVisible()
await page.goto('/portrait?y=1990&m=5&d=12')
await expect(page.getByRole('img', { name: '愈心谷' }).first()).toBeVisible()
await expect(page.locator('header').getByRole('button', { name: '添加档案' })).toBeVisible()
await page.goto('/psy/portrait?y=1990&m=5&d=12')
await expect(page.getByRole('navigation', { name: '主导航' })).toBeVisible()
await expect(page.getByRole('heading', { name: '个人画像' })).toBeVisible()
await expect(page.getByText('E2E画像')).toBeVisible()
await expect(page.getByText('模拟摘要')).toBeVisible()
await expect(page.getByRole('button', { name: /深度版/ })).toBeVisible()
await expect(page.getByRole('heading', { name: '愈心解码' })).toBeVisible()
await expect(page.getByText('模拟摘要').first()).toBeVisible()
await expect(page.getByRole('link', { name: /在报告页打开/ })).toBeVisible()
await expect(page.getByRole('button', { name: /解锁完整分析/ }).first()).toBeVisible()
})
+2
View File
@@ -10,6 +10,8 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
use: {
// SPA Vite base is /psy/; absolute paths must include the prefix
// (Playwright treats `/foo` as origin-absolute, ignoring base path).
baseURL: 'http://127.0.0.1:4173',
trace: 'on-first-retry',
},