fix(mini): preserve taskbar and restore login

This commit is contained in:
2026-07-22 19:03:24 +08:00
parent aeb5276a73
commit b01928a5e4
9 changed files with 49 additions and 16 deletions

View File

@@ -58,9 +58,8 @@ await page.route('http://localhost:9150/api/v1/**', async (route) => {
await page.goto(`http://127.0.0.1:${port}/`, { waitUntil: 'networkidle' })
await page.screenshot({ path: 'test-results/mini-login.png', fullPage: true })
await page.locator('.login-note input').nth(1).fill('demo@senlin.ai')
await page.locator('.login-note input').nth(2).fill('password123')
await page.getByRole('button', { name: '连接工作台' }).click()
const loginDefaults = await page.locator('.login-note input').evaluateAll((inputs) => inputs.map((input) => input.value))
await page.locator('.login-note input').nth(2).press('Enter')
await page.waitForSelector('.mini-shell')
await page.waitForTimeout(400)
await page.screenshot({ path: 'test-results/mini-home-right.png', fullPage: true })
@@ -97,6 +96,7 @@ await browser.close()
await server.close()
const failures = []
if (loginDefaults[1] !== 'demo@senlin.ai' || loginDefaults[2] !== 'password123') failures.push(`login defaults failed: ${JSON.stringify(loginDefaults)}`)
if (errors.length) failures.push(`console errors: ${errors.join('; ')}`)
if (home.width !== 420) failures.push(`expected 420px shell, got ${home.width}`)
if (home.navCount !== 5) failures.push(`expected five top navigation items, got ${home.navCount}`)