Files
his/openhis-ui-vue3/tests/e2e/specs/debug-page.spec.ts
华佗 473a2c974f refactor: rename openhis → healthlink-his (complete rebranding)
- Maven modules: openhis-* → healthlink-his-*
- Java packages: com.openhis → com.healthlink.his (3,278 files)
- Configuration: context-path, DB schema, logger, package scan
- Frontend: API paths /openhis/ → /healthlink-his/ (30 files)
- Database: healthlink_his schema with 188 tables (copied from hisdev)
- Verified: 18/18 API tests passed, 10-concurrent smoke test passed
2026-06-05 13:02:15 +08:00

42 lines
1.5 KiB
TypeScript

import { test, expect } from '@playwright/test';
test('debug page load', async ({ page }) => {
// 登录
await page.goto('http://localhost:81/');
const loginResp = await page.request.post('http://localhost:18082/healthlink-his/login', {
data: { username: 'doctor1', password: '123456', tenantId: '1', code: '', uuid: '' }
});
const loginData = await loginResp.json();
await page.context().addCookies([{
name: 'Admin-Token',
value: loginData.token,
domain: 'localhost',
path: '/'
}]);
// 导航到门诊医生站
await page.goto('http://localhost:81/clinicManagement/doctorStation');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(8000); // 等待更长时间
// 获取页面 HTML
const html = await page.content();
console.log('=== HTML 长度:', html.length);
console.log('=== 前 3000 字符 ===');
console.log(html.substring(0, 3000));
console.log('=== 检查 Vue app ===');
const appExists = await page.evaluate(() => !!document.querySelector('#app'));
console.log('App exists:', appExists);
const appChildren = await page.evaluate(() => document.querySelector('#app')?.children.length || 0);
console.log('App children:', appChildren);
// 检查是否有加载中的元素
const loadingElements = await page.evaluate(() => {
const els = document.querySelectorAll('.loading, .el-loading, [class*="loading"]');
return els.length;
});
console.log('Loading elements:', loadingElements);
await page.screenshot({ path: '/tmp/debug-page.png', fullPage: true });
});