Commit 9f7acde3 authored by Joshua Yu's avatar Joshua Yu

Merge branch 'main' into 'master'

update See merge request !24
parents 3b2caaeb 141e4d9e
...@@ -1134,7 +1134,7 @@ describe('case06: Filter => Success', function () { ...@@ -1134,7 +1134,7 @@ describe('case06: Filter => Success', function () {
await baseStep.screenShot(Driver, savaPath + '/09_filterStatus.jpeg'); await baseStep.screenShot(Driver, savaPath + '/09_filterStatus.jpeg');
await merchantInvoicePage.checkRecordInvoiceList(Driver, await merchantInvoicePage.checkRecordInvoiceList(Driver,
"", "Invoice", "Cancelled", "Stripe", testUser); "", "Invoice", "Cancelled", "", testUser);
done(); done();
} catch (e) { } catch (e) {
......
...@@ -12,7 +12,7 @@ const baseStep = require('../../../CommonStep/Web/Web_Common_Step'); ...@@ -12,7 +12,7 @@ const baseStep = require('../../../CommonStep/Web/Web_Common_Step');
const API_Object = require("../../../CommonStep/API/API_Object"); const API_Object = require("../../../CommonStep/API/API_Object");
const API_Env = require("../../../CommonStep/API/API_Env"); const API_Env = require("../../../CommonStep/API/API_Env");
const ApiReq = new API_Object(" "); const ApiReq = new API_Object("https://api.unibee.top");
const addContext = require('mochawesome/addContext'); const addContext = require('mochawesome/addContext');
const {expect} = require("chai"); const {expect} = require("chai");
...@@ -514,7 +514,10 @@ describe('case03: Transaction with Failed=> Success', function () { ...@@ -514,7 +514,10 @@ describe('case03: Transaction with Failed=> Success', function () {
const resBody = JSON.parse(res.body); const resBody = JSON.parse(res.body);
response = resBody; response = resBody;
console.log(resBody); console.log(resBody);
testData['subId'] = resBody.data.subscriptions[0].user.subscriptionId; for (let i = 0; i< 3; i++){
testData['subId_'+i] = resBody.data.subscriptions[i].subscription.subscriptionId;
}
done(); done();
}); });
}, 1000); }, 1000);
...@@ -523,11 +526,12 @@ describe('case03: Transaction with Failed=> Success', function () { ...@@ -523,11 +526,12 @@ describe('case03: Transaction with Failed=> Success', function () {
} }
}); });
for (let i =0; i< 3; i++){
it('Case 03: cancel sub => Success', (done) => { it('Case 03: cancel sub => Success', (done) => {
try { try {
setTimeout(() => {//Wait syncTimeAPI*1000 seconds setTimeout(() => {//Wait syncTimeAPI*1000 seconds
ApiReq.cancelSubscription(API_Env.get().headerSet, { ApiReq.cancelSubscription(API_Env.get().headerSet, {
"subscriptionId": testData['subId'] "subscriptionId": testData['subId_' + i]
}, (res, url, header, bodyObject) => { }, (res, url, header, bodyObject) => {
request = JSON.stringify(bodyObject); request = JSON.stringify(bodyObject);
request = { request = {
...@@ -551,6 +555,7 @@ describe('case03: Transaction with Failed=> Success', function () { ...@@ -551,6 +555,7 @@ describe('case03: Transaction with Failed=> Success', function () {
done(e); done(e);
} }
}); });
}
it('case 05 - Transaction with failed => Success ', (done) => { it('case 05 - Transaction with failed => Success ', (done) => {
(async () => { (async () => {
...@@ -907,7 +912,7 @@ describe('case05: Transaction filter => Success', function () { ...@@ -907,7 +912,7 @@ describe('case05: Transaction filter => Success', function () {
await merchantTransactionPage.filterStatus(Driver, ["Failed"]) await merchantTransactionPage.filterStatus(Driver, ["Failed"])
await baseStep.wait(Driver, 2000); await baseStep.wait(Driver, 2000);
await baseStep.screenShot(Driver, savaPath + '/05_RefundTransaction.jpeg'); await baseStep.screenShot(Driver, savaPath + '/05_RefundTransaction.jpeg');
await merchantTransactionPage.checkRecordTransactionList(Driver, "", "Failed", "Payment", "Stripe"); await merchantTransactionPage.checkRecordTransactionList(Driver, "", "Failed", "Payment", "");
done(); done();
......
...@@ -193,7 +193,6 @@ describe('case02: Assign subscription in user list=> Success', function () { ...@@ -193,7 +193,6 @@ describe('case02: Assign subscription in user list=> Success', function () {
await baseStep.click(Driver, userListPage.assign_OK_btn); await baseStep.click(Driver, userListPage.assign_OK_btn);
await baseStep.wait(Driver, 3000); await baseStep.wait(Driver, 3000);
await baseStep.screenShot(Driver, savaPath + "/08_assign_result.png"); await baseStep.screenShot(Driver, savaPath + "/08_assign_result.png");
await baseStep.compareText(Driver, userListPage.current_text, "Current Subscription");
await baseStep.compareText(Driver, userListPage.current_plan, "Month Plan"); await baseStep.compareText(Driver, userListPage.current_plan, "Month Plan");
await baseStep.compareText(Driver, userListPage.current_plan_des, "Month Plan"); await baseStep.compareText(Driver, userListPage.current_plan_des, "Month Plan");
await baseStep.compareText(Driver, userListPage.current_status, "Incomplete"); await baseStep.compareText(Driver, userListPage.current_status, "Incomplete");
...@@ -698,6 +697,7 @@ describe('case08:Set country and vat number in user list=> Success', function () ...@@ -698,6 +697,7 @@ describe('case08:Set country and vat number in user list=> Success', function ()
await baseStep.screenShot(Driver, savaPath + "/12_vat_number_country.png"); await baseStep.screenShot(Driver, savaPath + "/12_vat_number_country.png");
await baseStep.scrollIntoView(Driver, userListPage.save_btn); await baseStep.scrollIntoView(Driver, userListPage.save_btn);
await baseStep.click(Driver, userListPage.save_btn); await baseStep.click(Driver, userListPage.save_btn);
await baseStep.wait(Driver, 1000);
expect(await baseStep.getText(Driver, userListPage.vat_error_message)).not.null expect(await baseStep.getText(Driver, userListPage.vat_error_message)).not.null
await baseStep.wait(Driver, 3000); await baseStep.wait(Driver, 3000);
done(); done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment