import { expect, test } from '@playwright/test'; test('release build boots the setup wizard without runtime errors', async ({ page }) => { const pageErrors: string[] = []; const consoleErrors: string[] = []; page.on('pageerror', (error) => pageErrors.push(error.message)); page.on('console', (message) => { if (message.type() === 'error') consoleErrors.push(message.text()); }); await page.route('**/api/v1/setup/status', async (route) => { await route.fulfill({ json: { data: { required: true, locked: false, supportedDatabaseTypes: ['MYSQL'], message: '请完成安装', }, }, }); }); const response = await page.goto('/setup'); expect(response?.ok()).toBe(true); await expect(page.getByRole('heading', { name: '安装向导', exact: true })).toBeVisible(); expect(pageErrors).toEqual([]); expect(consoleErrors).toEqual([]); });