feat(GOV-009): 建立 Vue 前端工程基线
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('应用外壳在桌面和移动视口均可正常呈现', async ({ page }) => {
|
||||
const runtimeErrors: string[] = [];
|
||||
|
||||
page.on('console', (message) => {
|
||||
if (message.type() === 'error') runtimeErrors.push(message.text());
|
||||
});
|
||||
page.on('pageerror', (error) => runtimeErrors.push(error.message));
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.locator('main')).toBeVisible();
|
||||
await expect(page.getByText('A 股市场分析工具')).toBeVisible();
|
||||
|
||||
const hasHorizontalOverflow = await page.evaluate(
|
||||
() => document.documentElement.scrollWidth > document.documentElement.clientWidth,
|
||||
);
|
||||
expect(hasHorizontalOverflow).toBe(false);
|
||||
expect(runtimeErrors).toEqual([]);
|
||||
});
|
||||
Reference in New Issue
Block a user