PRELAUNCH 收口正式启用前公网预回归
这个提交包含在:
@@ -82,14 +82,15 @@ type LiveSummary = {
|
||||
error?: string;
|
||||
};
|
||||
|
||||
const issueId = "P2FLIVE";
|
||||
const issueId = process.env.QA_ISSUE_ID?.trim() || "P2FLIVE";
|
||||
const markerPrefix = process.env.P2_FIN_LIVE_MARKER_PREFIX?.trim() || issueId;
|
||||
const baseUrl = process.env.LIVE_SMOKE_BASE_URL?.trim() || "https://oa.hyinda.com";
|
||||
const reportDir = process.env.P2_FIN_LIVE_REPORT_DIR?.trim() ||
|
||||
path.resolve(process.cwd(), "..", "artifacts/qa-flow/p2-fin-live-local");
|
||||
const summaryPath = path.join(reportDir, "live-result.json");
|
||||
|
||||
function nowMarker() {
|
||||
return `P2FLIVE-${Date.now()}-${Math.random().toString(16).slice(2, 8)}`;
|
||||
return `${markerPrefix}-${Date.now()}-${Math.random().toString(16).slice(2, 8)}`;
|
||||
}
|
||||
|
||||
function today() {
|
||||
@@ -210,7 +211,7 @@ async function firstEnabledExpenseTypeId(api: APIRequestContext) {
|
||||
|
||||
async function createTestReimbursement(api: APIRequestContext, marker: string) {
|
||||
const reimbursement = await apiPostData<ReimbursementDetail>(api, "/api/reimbursements", {
|
||||
description: `P2FINLIVE 公网付款测试 ${marker}`,
|
||||
description: `${markerPrefix} 公网付款测试 ${marker}`,
|
||||
reimbursementDate: today(),
|
||||
});
|
||||
const expenseTypeId = await firstEnabledExpenseTypeId(api);
|
||||
@@ -218,7 +219,7 @@ async function createTestReimbursement(api: APIRequestContext, marker: string) {
|
||||
expenseTypeId,
|
||||
expenseDate: today(),
|
||||
amount: "168.30",
|
||||
description: `P2FINLIVE 小额测试 ${marker}`,
|
||||
description: `${markerPrefix} 小额测试 ${marker}`,
|
||||
});
|
||||
return apiGetData<ReimbursementDetail>(api, `/api/reimbursements/${reimbursement.id}`);
|
||||
}
|
||||
@@ -298,7 +299,7 @@ async function createPaymentBatch(api: APIRequestContext, input: { reimbursement
|
||||
entityIds: [input.reimbursementId],
|
||||
defaultPaymentDate: today(),
|
||||
defaultPaymentChannel: "bank",
|
||||
voucherPrefix: `P2LIVE-${input.marker.slice(-6)}`,
|
||||
voucherPrefix: `${markerPrefix.slice(0, 12)}-${input.marker.slice(-6)}`,
|
||||
});
|
||||
return data.item;
|
||||
}
|
||||
@@ -402,14 +403,14 @@ test.describe("P2-FIN-LIVE 公网付款批次短窗口", () => {
|
||||
admin.api,
|
||||
"payment_batch_v1",
|
||||
"force_on",
|
||||
`P2FLIVE short window ${marker}`,
|
||||
`${issueId} short window ${marker}`,
|
||||
);
|
||||
summary.stages.flagOn = { paymentFlagOn: snapshotFlag(paymentFlagOn) };
|
||||
expect(paymentFlagOn.effectiveEnabled).toBe(true);
|
||||
const erpFlagAfterPaymentOn = await loadFlag(admin.api, "erp_sync");
|
||||
expect(erpFlagAfterPaymentOn.effectiveEnabled, "erp_sync must not be opened by P2FLIVE").toBe(false);
|
||||
expect(erpFlagAfterPaymentOn.effectiveEnabled, `erp_sync must not be opened by ${issueId}`).toBe(false);
|
||||
|
||||
const batchName = `P2FINLIVE 公网付款批次 ${marker}`;
|
||||
const batchName = `${markerPrefix} 公网付款批次 ${marker}`;
|
||||
const adminWildcard = isWildcardSuperAdmin(admin);
|
||||
const rejectedCreate: Record<string, string | number> = {
|
||||
employee: await expectPostRejected(employee.api, "/api/payment-batches", {
|
||||
@@ -443,7 +444,7 @@ test.describe("P2-FIN-LIVE 公网付款批次短窗口", () => {
|
||||
: await expectPostRejected(admin.api, `/api/payment-batches/${batch.id}/execute`, {}, "admin-only execute payment batch");
|
||||
|
||||
batch = (await apiPostData<{ item: PaymentBatch }>(financeMgr.api, `/api/payment-batches/${batch.id}/review`, {
|
||||
comment: `P2FLIVE 复核 ${marker}`,
|
||||
comment: `${issueId} 复核 ${marker}`,
|
||||
})).item;
|
||||
expect(batch.reviewRequirement.completedReviewCount).toBeGreaterThanOrEqual(1);
|
||||
|
||||
@@ -493,7 +494,7 @@ test.describe("P2-FIN-LIVE 公网付款批次短窗口", () => {
|
||||
} finally {
|
||||
if (admin) {
|
||||
try {
|
||||
const rolledBack = await forcePaymentBatchOff(admin.api, `P2FLIVE rollback ${marker}`);
|
||||
const rolledBack = await forcePaymentBatchOff(admin.api, `${issueId} rollback ${marker}`);
|
||||
summary.stages.rollback = { paymentFlagAfterRollback: snapshotFlag(rolledBack) };
|
||||
expect(rolledBack.effectiveEnabled).toBe(false);
|
||||
} catch (error) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户