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

ci(cypress): Trustpay collection fix #4410

Open
wants to merge 14 commits into
base: refactor-cypress-for-more-control
Choose a base branch
from

Conversation

likhinbopanna
Copy link
Contributor

@likhinbopanna likhinbopanna commented Apr 22, 2024

Type of Change

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

Description

Fixed manual capture flow for Trustpay collection in cypress tool as manual capture is not supported for Trustpay and I've fixed the assertion since Trustpay and Bluesnap don't support mandates

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Trustpay and bluesnap collections were failing in cypress automation

How did you test it?

  • Trustpay collection
Untitled

image

  • Bluesnap collection
image [NOTE : 1 failure case is redirection flow ]
  • Stripe collection
stripetest

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
  • I added a CHANGELOG entry if applicable

…en-capture-status-handle

* 'main' of github.com:juspay/hyperswitch:
  ci(cypress): Add save card flow (#4327)
…en-capture-status-handle

* 'main' of github.com:juspay/hyperswitch:
  feat(router): add retrieve poll status api (#4358)
…press-for-more-control

* 'main' of github.com:juspay/hyperswitch:
  feat(payments): add amount and connector id filter in list (#4354)
  feat(connector): [NMI] External 3DS flow for Cards (#4385)
  test(cypress): Update ConnectorAuth Details (#4386)
  chore(version): 2024.04.18.0
  fix(router): make payment_instrument optional (#4389)
  fix(config): remove `merchant_business_country` from the connector configs as enums can not be handled in this toml file (#4383)
  feat(payment_link): Add support for saved payment method option for payment link (#4373)
@likhinbopanna likhinbopanna requested a review from a team as a code owner April 22, 2024 08:31
@likhinbopanna likhinbopanna changed the base branch from main to refactor-cypress-for-more-control April 22, 2024 09:05
@likhinbopanna likhinbopanna self-assigned this Apr 22, 2024
@likhinbopanna likhinbopanna added A-CI-CD Area: Continuous Integration/Deployment S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 22, 2024
@@ -25,7 +25,7 @@
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

// commands.js or your custom support file
import ConnectorAuthDetails from "../../../.github/secrets/creds.json";
Copy link
Member

Choose a reason for hiding this comment

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

revert

Copy link
Contributor

Choose a reason for hiding this comment

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

@pixincreate We can add the path as env then everyone would just export the path instead of updating it here!
We can take up that change in this pr may be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

@likhinbopanna is the change mentioned above is done?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have just reverted the connectorAuthDetails and that is done

Copy link
Member

Choose a reason for hiding this comment

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

I'll take this up and update it on my PR or raise another PR targeting this branch so that no conflicts would occur...

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

@prasunna09 prasunna09 left a comment

Choose a reason for hiding this comment

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

Also @likhinbopanna Could you add the test screenshot of assertions added for trustpay?

@@ -25,7 +25,7 @@
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

// commands.js or your custom support file
import ConnectorAuthDetails from "../../../.github/secrets/creds.json";
Copy link
Contributor

Choose a reason for hiding this comment

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

@pixincreate We can add the path as env then everyone would just export the path instead of updating it here!
We can take up that change in this pr may be?

Comment on lines +288 to +290
if (response.body.hasOwnProperty("status")) {
expect(response.body).to.have.property("status");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have a check for status code, if it is 2xx, they we always expect status, if 4xx, we ll always expect error code and message

Comment on lines +255 to +259
else if(response.body.error.type === "invalid_request") {
if(response.body.error.message === "Payment method type not supported") {
expect(response.body.error).to.deep.equal(Errors.paymentMethodErrors[globalState.get("connectorId")].paymentMethodUnsupportedError);
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to manual else if block, since we are explicitly saying Manual Capture for trustpay is not supported

@pixincreate pixincreate force-pushed the refactor-cypress-for-more-control branch 4 times, most recently from 0db9ca3 to fb73ec0 Compare April 29, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI-CD Area: Continuous Integration/Deployment S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants