Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
1
openhis-ui-vue3/.gitignore
vendored
1
openhis-ui-vue3/.gitignore
vendored
@@ -26,3 +26,4 @@ yarn.lock
|
|||||||
test-results/
|
test-results/
|
||||||
tests/e2e/report/
|
tests/e2e/report/
|
||||||
tests/tests/
|
tests/tests/
|
||||||
|
vite.config.js.timestamp*
|
||||||
|
|||||||
@@ -1,47 +1,83 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
import { LoginPage } from '../pages/LoginPage';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bug #630: Bug #630 待确认标题
|
* Bug #630: [门诊医生站] 点击选择现诊患者列表报错
|
||||||
* 自动生成: 2026-06-01 09:36:18
|
* 禅道信息:
|
||||||
|
* - 登录:doctor1 / 123456,租户=中联医院(tenantId=1)
|
||||||
|
* - 步骤:进入门诊医生站 → 点击左侧现诊患者 → 观察右侧加载
|
||||||
*/
|
*/
|
||||||
test.describe('🐛 Bug#630', () => {
|
test.describe('🐛 Bug#630 门诊医生站现诊患者列表', () => {
|
||||||
let loginPage: LoginPage;
|
test('#630 点击现诊患者不应报错 @bug630 @regression', async ({ page }) => {
|
||||||
|
// 1. 登录
|
||||||
test.beforeEach(async ({ page }) => {
|
await page.goto('http://localhost:81/');
|
||||||
loginPage = new LoginPage(page);
|
const loginResp = await page.request.post('http://localhost:18082/openhis/login', {
|
||||||
await loginPage.goto();
|
data: { username: 'doctor1', password: '123456', tenantId: '1', code: '', uuid: '' }
|
||||||
await loginPage.login(
|
|
||||||
process.env.TEST_USERNAME || 'admin',
|
|
||||||
process.env.TEST_PASSWORD || 'admin123'
|
|
||||||
);
|
|
||||||
await loginPage.expectLoginSuccess();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('#630 Bug #630 待确认标题 @bug630 @regression', async ({ page }) => {
|
|
||||||
await page.goto('/');
|
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
|
|
||||||
// 检查页面正常加载(非登录页)
|
|
||||||
await expect(page).not.toHaveURL(/.*login.*/);
|
|
||||||
|
|
||||||
// 检查无 JS 错误
|
|
||||||
const jsErrors: string[] = [];
|
|
||||||
page.on('pageerror', (err) => jsErrors.push(err.message));
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
// 页面基本可交互
|
|
||||||
const body = page.locator('body');
|
|
||||||
await expect(body).toBeVisible();
|
|
||||||
|
|
||||||
// 截图记录
|
|
||||||
await page.screenshot({
|
|
||||||
path: 'tests/e2e/report/bug-630-result.png',
|
|
||||||
fullPage: true
|
|
||||||
});
|
});
|
||||||
|
const loginData = await loginResp.json();
|
||||||
|
expect(loginData.code).toBe(200);
|
||||||
|
await page.context().addCookies([{
|
||||||
|
name: 'Admin-Token', value: loginData.token, domain: 'localhost', path: '/'
|
||||||
|
}]);
|
||||||
|
|
||||||
// 无 JS 错误
|
// 2. 进入首页
|
||||||
expect(jsErrors).toEqual([]);
|
await page.goto('http://localhost:81/index');
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
await page.waitForTimeout(3000);
|
||||||
|
|
||||||
|
// 3. 通过侧边栏导航到门诊医生站
|
||||||
|
await page.locator('text=门诊医生工作站').first().click();
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
await page.locator('text=门诊医生站').first().click();
|
||||||
|
await page.waitForTimeout(5000);
|
||||||
|
|
||||||
|
// 4. 验证"现诊患者"标签存在
|
||||||
|
const patientLabel = page.locator('text=现诊患者');
|
||||||
|
await expect(patientLabel).toBeVisible({ timeout: 10000 });
|
||||||
|
console.log('✅ 现诊患者标签可见');
|
||||||
|
|
||||||
|
// 5. 截图:门诊医生站页面
|
||||||
|
await page.screenshot({ path: 'test-results/bug-630-step1.png', fullPage: true });
|
||||||
|
|
||||||
|
// 6. 查找患者列表项(可能是表格行或列表项)
|
||||||
|
const patientSelectors = [
|
||||||
|
'.el-table__body tr',
|
||||||
|
'.patient-item',
|
||||||
|
'.current-patient',
|
||||||
|
'[class*="patient-list"] li',
|
||||||
|
'.list-item',
|
||||||
|
];
|
||||||
|
|
||||||
|
let clickedPatient = false;
|
||||||
|
for (const selector of patientSelectors) {
|
||||||
|
const items = page.locator(selector);
|
||||||
|
const count = await items.count();
|
||||||
|
if (count > 0) {
|
||||||
|
console.log(`找到 ${count} 个患者 (${selector})`);
|
||||||
|
try {
|
||||||
|
await items.first().click({ timeout: 5000 });
|
||||||
|
clickedPatient = true;
|
||||||
|
console.log('✅ 已点击患者');
|
||||||
|
break;
|
||||||
|
} catch {
|
||||||
|
console.log(`点击失败 (${selector})`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!clickedPatient) {
|
||||||
|
console.log('⚠️ 没有患者数据,测试环境可能无数据');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 等待右侧加载
|
||||||
|
await page.waitForTimeout(5000);
|
||||||
|
await page.screenshot({ path: 'test-results/bug-630-step2.png', fullPage: true });
|
||||||
|
|
||||||
|
// 8. 验证没有错误弹窗
|
||||||
|
const errorPopups = page.locator('.el-message--error');
|
||||||
|
const errorCount = await errorPopups.count();
|
||||||
|
console.log('错误弹窗:', errorCount);
|
||||||
|
|
||||||
|
await page.screenshot({ path: 'test-results/bug-630-final.png', fullPage: true });
|
||||||
|
expect(errorCount).toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
'/dev-api': {
|
'/dev-api': {
|
||||||
target: 'http://localhost:18080/openhis',
|
target: process.env.VITE_API_PROXY || 'http://localhost:18080/openhis',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, ''),
|
rewrite: (p) => p.replace(/^\/dev-api/, ''),
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user