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

refactor(cypress): move memory cache tests out of payment for misc #6992

Open
wants to merge 2 commits into
base: add-cypress-test-for-in-memory-cache
Choose a base branch
from

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Jan 6, 2025

Type of Change

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

Description

This PR aims at refactoring:

  • cypress-tests folder structure to reduce confusion and chaos in within e2e directory

    • previous:

       .
       └── cypress
           ├── e2e
           │   ├── PaymentMethodListTest
           │   ├── PaymentMethodListUtils
           │   ├── PaymentTest
           │   ├── PaymentUtils
           │   ├── PayoutTest
           │   ├── PayoutUtils
           │   ├── RoutingTest
           │   └── RoutingUtils
           ├── fixtures
           ├── support
           └── utils
    • present:

       .
       └── cypress
           ├── e2e
           │   ├── configs
           │   │   ├── Payment
           │   │   ├── PaymentMethodList
           │   │   ├── Payout
           │   │   └── Routing
           │   └── spec
           │       ├── Misc <- memory cache tests have been moved here
           │       ├── Payment
           │       ├── PaymentMethodList
           │       ├── Payout
           │       └── Routing
           ├── fixtures
           ├── support
           └── utils
  • reduce / remove duplicate commands in memory cache (config calls) by unifying them

    • test(cypress): add test for In Memory Cache #6961 introduces the memory cache test, but does not aim at optimising things. this pr is intended to address that
    • additionally, memory cache test have been moved out of payments service to misc just so that, tests that are independent of business profile, mca, merchant account can be added here in the future
  • new command addition to miscellaneous tests: npm run cypress:misc

  • slight security improvement by forcing the api key to expire within 24 hours

closes #6993

documentation will be updated later

Additional Changes

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

Motivation and Context

Too many boiler plates, too many useless code

How did you test it?

# executed below command to cherry-pick cookie changes just so that userlogin work
git cherry-pick -n ..fix-cookie-cypress

# started cypress against stripe
CYPRESS_CONNECTOR=stripe npm run cypress

stripe:
image

memory cache:
image

Checklist

  • I formatted the code npm run format
  • I addressed lints thrown by npm run lint
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@pixincreate pixincreate requested a review from a team as a code owner January 6, 2025 09:12
Copy link

semanticdiff-com bot commented Jan 6, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  cypress-tests/package.json  80% smaller
  cypress-tests/cypress/e2e/spec/Payment/00016-ThreeDSManualCapture.cy.js  76% smaller
  cypress-tests/cypress/e2e/spec/Payment/00027-DynamicFields.cy.js  68% smaller
  cypress-tests/cypress/e2e/configs/Payment/Cybersource.js  67% smaller
  cypress-tests/cypress/e2e/spec/Payment/00003-ConnectorCreate.cy.js  42% smaller
  cypress-tests/cypress/e2e/spec/Payment/00024-ConnectorAgnosticNTID.cy.js  41% smaller
  cypress-tests/cypress/e2e/spec/Payment/00026-BusinessProfileConfigs.cy.js  41% smaller
  cypress-tests/cypress/e2e/spec/Routing/00000-PriorityRouting.cy.js  39% smaller
  cypress-tests/cypress/e2e/spec/Routing/00001-VolumeBasedRouting.cy.js  39% smaller
  cypress-tests/cypress/e2e/spec/Routing/00002-RuleBasedRouting.cy.js  39% smaller
  cypress-tests/cypress/e2e/spec/Routing/00003-Retries.cy.js  38% smaller
  cypress-tests/cypress/e2e/spec/Payment/00000-CoreFlows.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00004-NoThreeDSAutoCapture.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00005-ThreeDSAutoCapture.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00006-NoThreeDSManualCapture.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00007-VoidPayment.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00008-SyncPayment.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00010-SyncRefund.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00013-ListAndRevokeMandate.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00017-BankTransfers.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingNTIDProxy.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00021-UPI.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00023-PaymentMethods.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00025-SessionCall.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payment/00028-IncrementalAuth.cy.js  37% smaller
  cypress-tests/cypress/e2e/spec/Payout/00003-CardTest.cy.js  36% smaller
  cypress-tests/cypress/e2e/spec/Payout/00004-BankTransfer.cy.js  36% smaller
  cypress-tests/cypress/e2e/spec/Payout/00005-SavePayout.cy.js  36% smaller
  cypress-tests/cypress/e2e/spec/PaymentMethodList/00000-PaymentMethodListTests.cy.js  16% smaller
  cypress-tests/cypress/support/commands.js  9% smaller
  cypress-tests/cypress/e2e/configs/Payout/Commons.js  2% smaller
  cypress-tests/cypress/e2e/configs/Payment/Commons.js  1% smaller
  cypress-tests/cypress/e2e/configs/Payment/Adyen.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Bluesnap.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Checkout.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Datatrans.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Elavon.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Fiservemea.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Fiuu.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Iatapay.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/ItauBank.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Jpmorgan.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Nexixpay.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Nmi.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Noon.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Novalnet.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Paybox.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Paypal.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Stripe.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Trustpay.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Utils.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/WellsFargo.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/WorldPay.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/_Reusable.js  0% smaller
  cypress-tests/cypress/e2e/configs/PaymentMethodList/Commons.js  0% smaller
  cypress-tests/cypress/e2e/configs/PaymentMethodList/Connector.js  0% smaller
  cypress-tests/cypress/e2e/configs/PaymentMethodList/Utils.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payout/Adyen.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payout/AdyenPlatform.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payout/Utils.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payout/Wise.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payout/_Reusable.js  0% smaller
  cypress-tests/cypress/e2e/configs/Routing/Adyen.js  0% smaller
  cypress-tests/cypress/e2e/configs/Routing/Autoretries.js  0% smaller
  cypress-tests/cypress/e2e/configs/Routing/Commons.js  0% smaller
  cypress-tests/cypress/e2e/configs/Routing/Stripe.js  0% smaller
  cypress-tests/cypress/e2e/configs/Routing/Utils.js  0% smaller
  cypress-tests/cypress/e2e/spec/Misc/00000-MemoryCacheConfigs.cy.js  0% smaller
  cypress-tests/cypress/e2e/spec/Payment/00001-AccountCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/spec/Payment/00002-CustomerCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/spec/Payout/00000-AccountCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/spec/Payout/00001-CustomerCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/spec/Payout/00002-ConnectorCreate.cy.js  0% smaller
  cypress-tests/cypress/utils/RequestBodyUtils.js  0% smaller

@pixincreate pixincreate self-assigned this Jan 6, 2025
@pixincreate pixincreate added A-CI-CD Area: Continuous Integration/Deployment S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jan 6, 2025
@pixincreate pixincreate added this to the December 2024 Release milestone Jan 6, 2025
@pixincreate pixincreate force-pushed the refactor-add-memory-cache branch from 0cc9122 to 960f4ef Compare January 6, 2025 09:16
@pixincreate pixincreate linked an issue Jan 6, 2025 that may be closed by this pull request
@pixincreate pixincreate force-pushed the refactor-add-memory-cache branch from 5377539 to 76b0ffa Compare January 7, 2025 09:24
@pixincreate pixincreate requested review from a team as code owners January 7, 2025 09:24
@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jan 7, 2025
@pixincreate pixincreate force-pushed the refactor-add-memory-cache branch from 76b0ffa to 08bfd71 Compare January 7, 2025 09:56
@pixincreate pixincreate force-pushed the refactor-add-memory-cache branch from 08bfd71 to c18cdbd Compare January 7, 2025 09:58
@hyperswitch-bot hyperswitch-bot bot removed M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jan 7, 2025
@pixincreate pixincreate removed request for a team January 7, 2025 09:58
@pixincreate pixincreate requested review from a team as code owners January 9, 2025 06:40
@pixincreate pixincreate requested a review from a team as a code owner January 9, 2025 06:40
@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jan 9, 2025
@pixincreate pixincreate force-pushed the refactor-add-memory-cache branch from b41407d to 931d5c0 Compare January 9, 2025 06:41
@hyperswitch-bot hyperswitch-bot bot removed M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jan 9, 2025
@pixincreate pixincreate removed request for a team January 9, 2025 06:41
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.

[REFACTOR] reduce duplicate code in config in cypress
1 participant