Files
lotteryLaravel/e2e/playwright.config.ts
kang 3f29229499
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
lotterLaravel E2E / e2e-api (push) Has been cancelled
fix: 部分收付累计释额并扩展结算 E2E 与 CI
账期收付改为按累计已付同步 credit_ledger,修复多笔 partial_paid 与坏账核销重复释额;新增 API E2E(占成、权限、部分收付/坏账)与 GitHub Actions e2e-api job。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 09:48:01 +08:00

64 lines
1.7 KiB
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.
import { defineConfig, devices } from '@playwright/test';
const API_URL = process.env.PLAYWRIGHT_API_URL ?? 'http://127.0.0.1:8000';
const ADMIN_URL = process.env.PLAYWRIGHT_ADMIN_URL ?? 'http://localhost:3801';
const FRONT_URL = process.env.PLAYWRIGHT_FRONT_URL ?? 'http://localhost:3800';
const ARTIFACT_DIR = 'artifacts';
/** 默认用本机 Google Chrome设 PLAYWRIGHT_USE_BUNDLED_CHROMIUM=1 则走 ms-playwright 自带 Chromium。 */
const uiBrowserUse = {
...devices['Desktop Chrome'],
...(process.env.PLAYWRIGHT_USE_BUNDLED_CHROMIUM === '1'
? {}
: { channel: 'chrome' as const }),
};
export default defineConfig({
testDir: './tests',
globalSetup: './global-setup.ts',
fullyParallel: false,
workers: 1,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: [
['list'],
['json', { outputFile: `${ARTIFACT_DIR}/test-results/results.json` }],
['html', { outputFolder: `${ARTIFACT_DIR}/playwright-report`, open: 'never' }],
],
outputDir: `${ARTIFACT_DIR}/test-output`,
timeout: 60_000,
expect: { timeout: 10_000 },
use: {
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'api',
testMatch: 'tests/api/**/*.spec.ts',
use: {
baseURL: API_URL,
extraHTTPHeaders: { 'Accept-Language': 'zh-CN' },
...devices['Desktop Chrome'],
},
},
{
name: 'admin-ui',
testMatch: 'tests/ui/admin*.spec.ts',
use: {
baseURL: ADMIN_URL,
...uiBrowserUse,
},
},
{
name: 'front-ui',
testMatch: 'tests/ui/front*.spec.ts',
use: {
baseURL: FRONT_URL,
...uiBrowserUse,
},
},
],
});