test(acceptance): align retained state fixtures
This commit is contained in:
@@ -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'}`)
|
||||
|
||||
Reference in New Issue
Block a user