17 lines
452 B
TypeScript
17 lines
452 B
TypeScript
|
|
import { test, expect } from '@playwright/test';
|
||
|
|
|
||
|
|
test('简单的访问测试', async ({ page }) => {
|
||
|
|
// 访问前端应用
|
||
|
|
await page.goto('http://localhost:3000');
|
||
|
|
|
||
|
|
// 检查页面标题
|
||
|
|
await expect(page).toHaveTitle(/frontend/);
|
||
|
|
|
||
|
|
// 截图
|
||
|
|
await page.screenshot({ path: 'screenshots/simple-e2e.png' });
|
||
|
|
|
||
|
|
// 检查是否有登录表单
|
||
|
|
const heading = page.getByText('图片分析系统');
|
||
|
|
await expect(heading).toBeVisible();
|
||
|
|
});
|