Files
his/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts
2026-05-27 11:16:13 +08:00

29 lines
1.1 KiB
TypeScript
Executable File

import { test, expect } from '@playwright/test';
test.describe('Bug Regression Tests', () => {
test('@bug001 @regression 基础登录流程正常', async ({ page }) => {
await page.goto('/login');
await expect(page).toHaveURL(/.*login/);
});
// 新增 Bug #603 回归测试
test('@bug603 @regression 住院发退药页面搜索栏布局正常,重置按钮可见', async ({ page }) => {
await page.goto('/inpatient/drugDispenseReturn');
await page.waitForLoadState('networkidle');
const resetBtn = page.getByRole('button', { name: '重置' });
await expect(resetBtn).toBeVisible();
const searchForm = page.locator('.search-form');
await expect(searchForm).toBeVisible();
// 验证布局未发生重叠或溢出
const formBox = await searchForm.boundingBox();
const btnBox = await resetBtn.boundingBox();
expect(formBox).not.toBeNull();
expect(btnBox).not.toBeNull();
// 确保按钮在表单容器可视范围内且未被其他元素遮挡
expect(btnBox.x + btnBox.width).toBeLessThanOrEqual(formBox.x + formBox.width + 5);
});
});