Files
lotteryLaravel/e2e/global-setup.ts
kang c83343e989
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
lotterLaravel E2E / e2e-api (push) Has been cancelled
fix(settlement): 操作记录分页、流水动作与坏账幂等加固
- 新增 settlement-operations 合并列表 API,收付/调账接口改为标准分页
- actionable_only 流水在内存过滤后正确分页
- 已结账单流水不再展示补差/冲正快捷动作
- 坏账核销支持 idempotency_key 并写入 result_bill_id
- 补充操作记录、流水与坏账幂等相关测试
2026-06-26 16:40:46 +08:00

28 lines
943 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Playwright global setup指向 mock 主站钱包、tick 期号调度。
*/
import { request as pwRequest } from '@playwright/test';
export default async function globalSetup(): Promise<void> {
const api = process.env.PLAYWRIGHT_API_URL ?? 'http://127.0.0.1:8000';
const mockPort = process.env.E2E_MOCK_WALLET_PORT ?? '5555';
const ctx = await pwRequest.newContext({ baseURL: api });
const siteCode = process.env.E2E_PLAYER_SITE_CODE ?? 'demo';
const walletResp = await ctx.post('/api/v1/_e2e/site/wallet-api', {
data: {
site_code: siteCode,
base_url: `http://127.0.0.1:${mockPort}`,
wallet_api_key: 'e2e-mock-key',
},
});
if (!walletResp.ok()) {
const body = await walletResp.text().catch(() => '');
throw new Error(`e2e wallet-api setup failed: ${walletResp.status()} ${body.slice(0, 400)}`);
}
await ctx.post('/api/v1/_e2e/draw/tick', { data: {} });
await ctx.dispose();
}