Skip to content
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

test: Add E2E card payment failure flow for Adyen connector. #752

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Bluesparx
Copy link

@Bluesparx Bluesparx commented Oct 25, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Fixes issue: juspay/hyperswitch#6081.

Description

This PR implements handling of failure cases in the Adyen card payment flow:

  • Testing Adyen Payment Flow: Introduced a Cypress test flow to simulate card payment failures during the Adyen payment flow.
  • Failure Simulation: Handles invalid card details, captures and logs the system's response to simulate a failed payment.

Test cases it checks:

  1. Render title of the payment page correctly.
  2. Verifying that the orca-payment-element iframe loads successfully.
  3. Submitting a payment form with invalid card details and verifying the failure response.

How did you test it?

I tested the new features by implementing automated tests using Cypress. The tests included:

Screenshot 2024-10-25 104137

  • Simulated Payment Failures: Input invalid card details to ensure the system correctly handles payment failures.
  • Verification of System Response: Each test verifies that the expected failure messages and UI elements are displayed correctly.

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Copy link

semanticdiff-com bot commented Oct 25, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  cypress-tests/cypress/e2e/adyen-card-flow-e2e-failure.cy.ts  0% smaller

@PritishBudhiraja PritishBudhiraja added the Testing Add this label if the PR contains Testing related changes label Oct 29, 2024
@Sanskar2001 Sanskar2001 added the Hacktoberfest Issues that are up for grabs for Hacktoberfest participants label Oct 29, 2024
cypress-tests/cypress.env.json Outdated Show resolved Hide resolved
cypress-tests/cypress/support/types.ts Outdated Show resolved Hide resolved
cypress-tests/cypress/support/commands.ts Outdated Show resolved Hide resolved
"#orca-payment-element-iframeRef-orca-elements-payment-element-payment-element";
const adyenIframeSelector = ".adyen-checkout__iframe--threeDSIframe";

changeObjectKeyValue(createPaymentBody, "profile_id", Cypress.env("PROFILE_ID"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
changeObjectKeyValue(createPaymentBody, "profile_id", Cypress.env("PROFILE_ID"));
changeObjectKeyValue(createPaymentBody, "profile_id", connectorProfileIdMapping.get(connectorEnum.ADYEN));

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm having problem running this command connectorProfileIdMapping it is not defined anywhere in commands or types.ts .. where do I need to import it from?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a pull from main

@PritishBudhiraja PritishBudhiraja changed the title Test: Add E2E card payment failure flow for Adyen connector. test: Add E2E card payment failure flow for Adyen connector. Nov 4, 2024
@Bluesparx Bluesparx closed this Nov 7, 2024
@Bluesparx
Copy link
Author

Bluesparx commented Nov 7, 2024

Sorry, while resolving some conflicts I accidentally closed the PR. could you pls reopen it @gorakhnathy7 @Sanskar2001

@gorakhnathy7 gorakhnathy7 reopened this Nov 8, 2024
@Bluesparx
Copy link
Author

I've made the requested changes. pls review @Sanskar2001 @seekshiva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Issues that are up for grabs for Hacktoberfest participants hacktoberfest-accepted Testing Add this label if the PR contains Testing related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants