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): Add 3DS flow test for connectors #4454

Merged
merged 5 commits into from
Apr 25, 2024
Merged

Conversation

Gnanasundari24
Copy link
Contributor

@Gnanasundari24 Gnanasundari24 commented Apr 24, 2024

Type of Change

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

Description

Added 3ds flow testcases for adyen,nmi,cybersource,bankofamerica,trustpay connector in cypress.

Additional Changes

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

Motivation and Context

3DS testcases were failing in pipeline

How did you test it?

Adyen
Screenshot 2024-04-24 at 5 25 49 PM

cybersource
Screenshot 2024-04-24 at 5 32 12 PM

Bankofamerica
Screenshot 2024-04-24 at 5 46 03 PM

trustpay
Screenshot 2024-04-24 at 5 48 30 PM

Testcases running for entire changes
Cybersource
Screenshot 2024-04-25 at 1 10 46 PM

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

Comment on lines 39 to 43
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move this connector specific metadata to connector utils?

Comment on lines 37 to 41
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, move this to connector utils

@Gnanasundari24 Gnanasundari24 self-assigned this Apr 25, 2024
@Gnanasundari24 Gnanasundari24 added this to the April 2024 milestone Apr 25, 2024
@@ -9,7 +9,7 @@
"api_key": "api-key",
"key1": "value1"
},
"test_mode": false,
"test_mode": true,
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this affect other connectors? From what I know, this is needed only for specific connectors like Mollie?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No test_mode should be true only for sandbox and for all connector.
It wont affect any connectors if its true

}

else {
// If connectorId is not "adyen", wait for 10 seconds
Copy link
Member

Choose a reason for hiding this comment

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

I think we can change the comment to something like:

Suggested change
// If connectorId is not "adyen", wait for 10 seconds
// If connectorId is neither of adyen, trustpay, nmi, stripe, bankofamerica or cybersource, wait for 10 seconds

Comment on lines 743 to 763
else if (globalState.get("connectorId") === "trustpay" ) {
cy.get('form[name="challengeForm"]',{ timeout: 10000 }).should('exist').then(form => {
cy.get('#outcomeSelect').select('Approve').should('have.value', 'Y')
cy.get('button[type="submit"]').click();
})
}
else if (globalState.get("connectorId") === "nmi" || globalState.get("connectorId") === "noon") {
cy.get('iframe',{ timeout: 100000 })
.its('0.contentDocument.body')
.within((body) => {
cy.get('iframe',{ timeout: 10000 })
.its('0.contentDocument.body')
.within((body) => {
cy.get('form[name="cardholderInput"]',{ timeout: 10000 }).should('exist').then(form => {
cy.get('input[name="challengeDataEntry"]').click().type("1234");
cy.get('input[value="SUBMIT"]').click();
})
})
})
}

Copy link
Member

Choose a reason for hiding this comment

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

Also, can we have this if else block to be in alphabetical order of connector names for easier look ups? We will anyway move this to a separate file so that we can have all redirection in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I made the change

@pixincreate
Copy link
Member

🤦‍♂️

Merged via the queue into main with commit 83ca04e Apr 25, 2024
10 of 12 checks passed
@likhinbopanna likhinbopanna deleted the 3dsflowtest branch April 25, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants