test(acceptance): align retained state fixtures

This commit is contained in:
2026-09-02 13:59:05 +08:00
parent f4c139815c
commit 5d098c9762
4 changed files with 92 additions and 75 deletions
@@ -39,9 +39,11 @@ async function raw(context, method, path, body, token, headers = {}) {
async function loginMerchant(context) {
const account = context.context?.merchantQualificationFixture
if (!account?.username || !account?.password) throw new Error('缺少本轮客户登录凭据')
const username = account?.username || process.env.MERCHANT_TEST_USERNAME || ''
const password = account?.password || process.env.MERCHANT_TEST_PASSWORD || ''
if (!username || !password) throw new Error('缺少客户登录凭据')
const response = await context.request('POST', '/api/auth/login', {
username: account.username, password: account.password,
username, password,
}, '')
const token = success(response) ? response.body?.data?.accessToken : null
if (!token) throw new Error(`本轮客户登录失败: requestId=${response?.requestId || 'missing'}, traceId=${response?.traceId || 'missing'}`)