提交 d1848671 编写于 作者: W WOSHIMAHAIFENG

pay自动化测试

上级 a847f5f0
......@@ -13,7 +13,7 @@ describe("payment", () => {
await page.setData({
orderinfo: orderInfo,
})
await page.callMethod('pay')
await page.callMethod('jest_pay')
await page.waitFor(10000);
expect((await page.data())['errorCode']).toEqual(700711)
});
......@@ -25,7 +25,7 @@ describe("payment", () => {
await page.setData({
orderinfo: orderInfo,
})
await page.callMethod('pay')
await page.callMethod('jest_pay')
await page.waitFor(6000);
expect((await page.data())['errorCode']).toEqual(700712)
});
......
......@@ -29,7 +29,7 @@
provider: "alipay",
orderInfo: res.data as string,
fail: (res : RequestPaymentFail) => {
console.log(JSON.stringify(res))
console.log(JSON.stringify(res))
this.errorCode = res.errCode
uni.showToast({
icon: 'error',
......@@ -49,6 +49,20 @@
uni.hideLoading()
},
});
},
//自动化测试使用
jest_pay() {
uni.requestPayment({
provider: "alipay",
orderInfo: this.orderInfo,
fail: (res : RequestPaymentFail) => {
console.log(JSON.stringify(res))
this.errorCode = res.errCode
},
success: (res : RequestPaymentSuccess) => {
console.log(JSON.stringify(res))
}
} as RequestPaymentOptions)
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册