-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(postman): postman tests fixes #7159
base: main
Are you sure you want to change the base?
Conversation
@@ -48,6 +48,7 @@ | |||
}, | |||
"test_mode": false, | |||
"disabled": false, | |||
"metadata": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function () { | ||
pm.expect(jsonData.status).to.eql("succeeded"); | ||
pm.expect(jsonData.status).to.eql("processing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,7 +51,7 @@ | |||
"card_number": "4111111111111111", | |||
"card_exp_month": "03", | |||
"card_exp_year": "2030", | |||
"card_holder_name": "CLBRW1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,7 +51,7 @@ | |||
"card_number": "4111111111111111", | |||
"card_exp_month": "03", | |||
"card_exp_year": "2030", | |||
"card_holder_name": "CLBRW1", | |||
"card_holder_name": "Juspay Hyperswitch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (jsonData?.amount) { | ||
pm.test( | ||
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", | ||
function () { | ||
pm.expect(jsonData.amount_capturable).to.eql(0); | ||
pm.expect(jsonData.amount_capturable).to.eql(jsonData.amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the reason that Payments Captured Manually are staying in processing
, the amount_capturable
will be equal to the full amount
.
pm.response.to.be.success; | ||
// Validate status 4xx | ||
pm.test("[POST]::/refunds - Status code is 4xx", function () { | ||
pm.response.to.have.status(400); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -24,6 +24,13 @@ if (jsonData?.refund_id) { | |||
jsonData.refund_id, | |||
); | |||
} else { | |||
pm.collectionVariables.set("refund_id", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the reason that Refunds are not able to get created because of the above mentioned reason, the value of refund_id
could not be set using:
pm.collectionVariables.set("refund_id", jsonData.refund_id);
So, it takes the most recent value of refund_id
which it gets from /postman/collection-dir/cybersource/Flow Testcases/Happy Cases/Scenario9-Add card flow/Refunds - Create/request.json
.
pm.test( | ||
"[POST]::/refunds - Content check if 'error.message' matches 'This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured'", | ||
function () { | ||
pm.expect(jsonData.error.message).to.eql("This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapped the error message accordingly for not being able to create a refund.
@@ -40,7 +27,7 @@ if (jsonData?.status) { | |||
} | |||
|
|||
// Response body should have value "6540" for "amount" | |||
if (jsonData?.status) { | |||
if (jsonData?.status && pm.collectionVariables.get("refund_id") !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion was failing due to the refund_id
issue in the Refunds - Create
. Because it was assigned with the refund_id
value of Scenario9-Add card flow/Refunds - Create
which had the amount of 600
, the assertion in this conditional statement was failing expecting it to be 540
according to the request created in Scenario11-Save card payment with manual capture
…nd add error message check for refunds
@@ -40,7 +40,7 @@ | |||
"card": { | |||
"card_number": "4242424242424242", | |||
"card_exp_month": "01", | |||
"card_exp_year": "25", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
January 2025 is no more a valid expiration.
@@ -40,7 +40,7 @@ | |||
"card": { | |||
"card_number": "4242424242424242", | |||
"card_exp_month": "01", | |||
"card_exp_year": "25", | |||
"card_exp_year": "35", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, changed it to January 2035.
pm.test( | ||
"[POST]::/refunds - Content check if value for 'error.message' matches 'Refund does not exist in our records.'", | ||
function () { | ||
pm.expect(jsonData.error.message).to.eql("Refund does not exist in our records."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assertion to check the Error Message.
@@ -36,7 +36,7 @@ if (jsonData?.error?.message) { | |||
pm.test( | |||
"[POST]::/payments/:id/confirm - Content check if value for 'error.reason' matches ' mandate payment is not supported by nmi'" , | |||
function () { | |||
pm.expect(jsonData.error.reason).to.eql(" mandate payment is not supported by nmi"); | |||
pm.expect(jsonData.error.reason).to.eql("credit mandate payment is not supported by nmi"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… cases for trustpay connector
|
||
// Add a delay of 10 seconds after the last | ||
setTimeout(function () { | ||
console.log("Delay of 10 seconds completed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refunds were failing with
"error_message": "unspecified error",
"error_code": "No error code",
"unified_code": "UE_9000",
"unified_message": "Something went wrong"
because of immediate refund of payment confirmed, giving a delay ensures successful Refund
.
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Connector:
adyen_uk
Note: The
Sofort
Test Cases are removed in PR #7099 after being deprecated byadyen
connector.Connector:
bluesnap
Connector:
cybersource
Before
![image](https://private-user-images.githubusercontent.com/88739246/408772303-897fd331-ae52-46df-b03f-60fa835f7bf6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjQ3MzYsIm5iZiI6MTczOTAyNDQzNiwicGF0aCI6Ii84ODczOTI0Ni80M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MTk3MDE0ZGRkODI2ZGQzNTA3YmZkOGRhOTVmODNiYzUzMThhY2UzY2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GpRZK6gU6ic_g9p33rmGHPTLbhX4GvTtTjVVwmHrQ0g)
Connector:
nmi
Before
![image](https://private-user-images.githubusercontent.com/88739246/408774125-9f2d01b8-b8db-4353-8e31-13c9b0fe1bb5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjQ3MzYsIm5iZiI6MTczOTAyNDQzNiwicGF0aCI6Ii84ODczOTI0Ni80MDg3NzQxMjUtOWYyZDAxYjgtYjhkYi00MzUzLThlMzEtMTNjOWIwZmUxYmI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE0MjAzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlMjhiMTQ1NTFiYTNmM2YxYTJmODA2ZjU2MTQ2MWQ2OGY2NDQ5NDdiMzdmNGNmYWFlMDJmODgyYjc1NGQyZjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.J0McW8h0vESlXTXeBJ2xwketHCwa80DrMnWZj5xLYKQ)
After
![image](https://private-user-images.githubusercontent.com/88739246/408779363-5e4d596a-7a1b-400c-b0e1-50179392ae10.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjQ3MzYsIm5iZiI6MTczOTAyNDQzNiwicGF0aCI6Ii84ODczOTI0Ni80MDg3NzkzNjMtNWU0ZDU5NmEtN2ExYi00MDBjLWIwZTEtNTAxNzkzOTJhZTEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE0MjAzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkODFmNmYzNTBhYWMzNmEwNjc3NGE4NTY5M2Q3ZTMyNjkxZDRkZjFmNDgwZWEzMmM0NzdlZjA3ZmNiMmVjYmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SN1cyLAHyI3GrdE5GXmL_3lDXNCqKl2dgQazOw4wnwQ)
Connector:
paypal
Connector:
stripe
Failing too inconsistently. Different number of test cases are failing. It is not even the same test cases each time it fails.
Connector:
trustpay
Before
![image](https://private-user-images.githubusercontent.com/88739246/408787213-8807d1fc-d845-4ea3-b8ba-d922bdd63af4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjQ3MzYsIm5iZiI6MTczOTAyNDQzNiwicGF0aCI6Ii84ODczOTI0Ni80MDg3ODcyMTMtODgwN2QxZmMtZDg0NS00ZWEzLWI4YmEtZDkyMmJkZDYzYWY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE0MjAzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllM2RiYmNhYzU4NGIyY2NlYWNkYTNiOGNlMDQzMWZhNzVmMTE4MTA3ODcwOWQ4MTA3MGQ2NDFiM2EzZDBhMDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pHqFoPOy2-eKjBPJJ2al69WFBU1nVu-vqWuBcE8WOuo)
![image](https://private-user-images.githubusercontent.com/88739246/408994697-4418045f-43dd-4d3c-966d-f09063f76b80.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjQ3MzYsIm5iZiI6MTczOTAyNDQzNiwicGF0aCI6Ii84ODczOTI0Ni80MDg5OTQ2OTctNDQxODA0NWYtNDNkZC00ZDNjLTk2NmQtZjA5MDYzZjc2YjgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE0MjAzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI4MWExY2UzYzUxNTdkYWY5ZDdhNDE3MTBhZWEwOTgyOTgzNzAzMTg4NGJhYWFjODc2Y2RiYjdkODlhYTI5NGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.DlMSzfVb-kREC03kGcwiiG-3uhkS8OgKdKynCWx6Lfk)
After
Checklist
cargo +nightly fmt --all
cargo clippy