fix(acceptance): reuse configured merchant credentials
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
const MODULE = 'inbound-fees'
|
||||
const OPTIONS = { scenario: 'inbound-fee-lifecycle', deploymentBlocker: true }
|
||||
const MERCHANT_USERNAME = process.env.MERCHANT_TEST_USERNAME || ''
|
||||
const MERCHANT_PASSWORD = process.env.MERCHANT_TEST_PASSWORD || ''
|
||||
|
||||
function id(value) { return value === null || value === undefined ? '' : String(value) }
|
||||
function success(response) { return response?.http === 200 && String(response?.body?.code) === '200' }
|
||||
@@ -134,7 +136,8 @@ export async function run(context) {
|
||||
const orderId = id(fixture?.orderId)
|
||||
const merchantFixture = context.context?.merchantQualificationFixture
|
||||
const merchantLoginResponse = await context.request('POST', '/api/auth/login', {
|
||||
loginId: merchantFixture?.username, password: merchantFixture?.password,
|
||||
loginId: merchantFixture?.username || MERCHANT_USERNAME,
|
||||
password: merchantFixture?.password || MERCHANT_PASSWORD,
|
||||
}, '')
|
||||
const merchantLogin = context.apiSuccess(MODULE, 'Client 登录并准备确认计费量和费用', merchantLoginResponse,
|
||||
`orderId=${orderId || 'missing'}`, OPTIONS)
|
||||
|
||||
Reference in New Issue
Block a user