ci(cypress): fix Nuvei cypress test cases
Type of Change
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
Description
Description
This PR fixes failing Nuvei connector Cypress tests by implementing proper 3DS redirect handling, adding required billing information, and optimizing timing configurations.
Changes
1. 3DS Redirect Handler (redirectionHandler.js)
Implemented Nuvei-specific 2-step authentication flow:
- Step 1: Click "Success authentication" button (#btn1/#btn5)
- Step 2: Wait for and click "Redirect" button to return to merchant
- Uses element visibility checks with timeouts instead of arbitrary waits
- Handles cross-origin redirects with
cy.origin() - Follows same pattern as existing connectors (paysafe, airwallex, adyen)
2. Nuvei Configuration (Nuvei.js)
- Billing Address: Added for manual capture flows (prevents authorization failures)
- Timing Delays: 5s for capture/refund operations, 3s for void
- Validation: Removed strict
payment_method_datavalidation (Nuvei returns dynamic metadata) - Payment Methods: Omitted iDEAL and EPS (not implemented in connector)
3. Bank Redirect Test Handling (00018-BankRedirect.cy.js)
- Added conditional skip for iDEAL and EPS tests when connector is Nuvei
- Prevents test failures for unimplemented payment methods
- Maintains test coverage for supported methods (Giropay, Sofort, Przelewy24)
Additional Changes
- [x] This PR modifies test configuration files
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
Nuvei Cypress Tests were failing.
How did you test it?
Some Manual Capture Edge Cases:** May experience intermittent failures due to Nuvei sandbox sync issues
Checklist
- [ ] I formatted the code
cargo +nightly fmt --all - [ ] I addressed lints thrown by
cargo clippy - [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
Changed Files
| File | Status |
|---|---|
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:warning: Please upload report for BASE (main@0a4b7ce). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## main #9908 +/- ##
=======================================
Coverage ? 3.89%
=======================================
Files ? 1224
Lines ? 303260
Branches ? 0
=======================================
Hits ? 11804
Misses ? 291456
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Nuvei supports mandates right ? But why the mandates test cases are skipping ? can you please debug and fix it really works