// apps/miniprogram/e2e/flows/patient-health-view.spec.ts import { describe, it, expect, beforeAll, afterAll } from 'vitest'; import { AutomatorClient } from '../helpers/automator-client'; import { MpAuthHelper } from '../helpers/auth.helper'; import { MpApiClient } from '../helpers/api-client'; import { MpNavigator } from '../helpers/navigation.helper'; describe('患者健康数据查看链路', () => { let client: AutomatorClient; let auth: MpAuthHelper; let nav: MpNavigator; let api: MpApiClient; beforeAll(async () => { api = new MpApiClient(); client = new AutomatorClient(); await client.connect(); auth = new MpAuthHelper(client, api); nav = new MpNavigator(client); }, 30_000); afterAll(async () => { await client.disconnect(); }); it('登录后查看首页健康数据', async () => { await auth.loginAsTestPatient(); await nav.goToHealthHome(); const pageData = await client.getPageData(); expect(pageData).toBeDefined(); }); it('查看体征趋势', async () => { await nav.goToVitalSignsTrend(); const el = await client.waitForElement('.trend-chart, canvas, .container', 5000); expect(el).toBeDefined(); }); it('查看随访任务列表', async () => { await nav.goToFollowUpTasks(); const el = await client.waitForElement('.task-list, .container', 5000); expect(el).toBeDefined(); }); });