// apps/miniprogram/e2e/flows/points-flow.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); await auth.loginAsTestPatient(); }, 30_000); afterAll(async () => { await client.disconnect(); }); it('浏览积分商城', async () => { await nav.goToMall(); const el = await client.waitForElement('.product-list, .container', 5000); expect(el).toBeDefined(); }); it('查看商品详情', async () => { const items = await client.getElements('.product-item, .product-card'); if (items.length > 0) { await items[0].tap(); const pageData = await client.getPageData(); expect(pageData).toBeDefined(); } }); it('查看订单列表', async () => { await nav.goToOrders(); const el = await client.waitForElement('.order-list, .container, .empty', 5000); expect(el).toBeDefined(); }); });