Skip to content

Commit

Permalink
feat(cypress): make tests forcefully skippable (#5176)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate authored Jul 4, 2024
1 parent c8c0cb7 commit bf9893e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe("Card - SingleUse Mandates flow test", () => {
);

context(
"Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow test",
"Card - No threeDS Create + Confirm Manual CIT and MIT payment flow test",
() => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails

Expand Down
2 changes: 2 additions & 0 deletions cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const connectorDetails = {
},
Response: {
status: 200,
trigger_skip: true,
body: {
status: "requires_capture",
},
Expand All @@ -59,6 +60,7 @@ export const connectorDetails = {
},
Response: {
status: 200,
trigger_skip: true,
body: {
status: "succeeded",
},
Expand Down
2 changes: 2 additions & 0 deletions cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const connectorDetails = {
},
Response: {
status: 200,
trigger_skip: true,
body: {
status: "requires_capture",
},
Expand All @@ -61,6 +62,7 @@ export const connectorDetails = {
},
Response: {
status: 200,
trigger_skip: true,
body: {
status: "succeeded",
},
Expand Down
4 changes: 4 additions & 0 deletions cypress-tests/cypress/e2e/PaymentUtils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export function getValueByKey(jsonObject, key) {
}

export const should_continue_further = (res_data) => {
if (res_data.trigger_skip !== undefined) {
return !res_data.trigger_skip;
}

if (
res_data.body.error !== undefined ||
res_data.body.error_code !== undefined ||
Expand Down

0 comments on commit bf9893e

Please sign in to comment.