Skip to content

Commit

Permalink
ci(Postman): Fix for automation test failure (#2949)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnanasundari24 authored Nov 22, 2023
1 parent f4d534c commit 160acc8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"amount_to_capture": 6570,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"amount_to_capture": 8040,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,22 @@ if (jsonData?.amount) {
);
}

// Response body should have value "6000" for "amount_received"
// Response body should have value "6540" for "amount_received"
if (jsonData?.amount_received) {
pm.test(
"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'",
"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'",
function () {
pm.expect(jsonData.amount_received).to.eql(6000);
pm.expect(jsonData.amount_received).to.eql(6540);
},
);
}

// Response body should have value "6540" for "amount_capturable"
// Response body should have value "0" for "amount_capturable"
if (jsonData?.amount_capturable) {
pm.test(
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'",
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'",
function () {
pm.expect(jsonData.amount_capturable).to.eql(6540);
pm.expect(jsonData.amount_capturable).to.eql(0);
},
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"raw_json_formatted": {
"amount_to_capture": 6000,
"amount_to_capture": 6540,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ if (jsonData?.amount) {
);
}

// Response body should have value "6000" for "amount_received"
// Response body should have value "6540" for "amount_received"
if (jsonData?.amount_received) {
pm.test(
"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'",
"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'",
function () {
pm.expect(jsonData.amount_received).to.eql(6000);
pm.expect(jsonData.amount_received).to.eql(6540);
},
);
}

// Response body should have value "6540" for "amount_capturable"
// Response body should have value "0" for "amount_capturable"
if (jsonData?.amount) {
pm.test(
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'",
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'",
function () {
pm.expect(jsonData.amount_capturable).to.eql(0);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ if (jsonData?.client_secret) {
// Response body should have value "succeeded" for "status"
if (jsonData?.status) {
pm.test(
"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'",
"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'",
function () {
pm.expect(jsonData.status).to.eql("succeeded");
pm.expect(jsonData.status).to.eql("partially_captured");
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ if (jsonData?.client_secret) {
// Response body should have value "succeeded" for "status"
if (jsonData?.status) {
pm.test(
"[POST]::/payments - Content check if value for 'status' matches 'succeeded'",
"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'",
function () {
pm.expect(jsonData.status).to.eql("succeeded");
pm.expect(jsonData.status).to.eql("partially_captured");
},
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
Expand All @@ -60,7 +62,9 @@
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
Expand Down

0 comments on commit 160acc8

Please sign in to comment.