You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_0 (already cloned)
- Base commit: 00e056800cb2c75c4dfbed6a4451658fda9c4a86
- Task ID: juspay__hyperswitch-7620
- Version: v1.113.0
TASK DESCRIPTION: Bug: feat(cypress):
connectorUpdateCallfails due to fixtures overwriteThe
connectorUpdateCallfails in the Cypress Tests for connectors for which a certain metadata field isrequired(for e.g.,Braintree) because thecypress-tests/cypress/fixtures/update-connector-body.jsonoverwrites the Request Body.DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
The Connector Update Body is being overwritten, which included the metadata as well. Due to this, if there were any required metadata fields of a connector, then the Connector Update Test would fail.
For example,
Braintreeconnector has a required metadata field, and while testing the Connector Update, just because it was being overwritten by theupdate-connector-body.jsonfixture, the test fails as shown in the following screenshot.Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
While adding the Card test Flows for the
Braintreeconnector, the Connector Update Test Failed.How did you test it?
Running the
0000-CoreFlows.cy.jsfor connector Assistant
I'll analyze the bug with
connectorUpdateCallfailing due to fixtures overwrite in the Cypress tests. Let me first understand the issue by examining the relevant files.Assistant
Let me first examine the fixture file that's causing the issue:
Assistant
Now let me find the connectorUpdateCall implementation in the Cypress tests:
Assistant
Let me search more broadly for connector-related Cypress tests:
Assistant
(no content)
Assistant
Let me check what's in the cypress-tests directory:
Assistant
(no content)
Assistant
Let me search for connector update related tests:
Assistant
Let me look at the support commands where connectorUpdateCall is likely defined:
Assistant
(no content)
Assistant
Let me search for a broader pattern to understand how the connector update tests work:
Assistant
(no content)
Assistant
Let me look at the specific CoreFlows test file that was mentioned in the issue:
Assistant
(no content)
Assistant
Let me find the correct path to the CoreFlows file:
Assistant
(no content)
Assistant
Now I found the issue! On line 147-153, we can see the connectorUpdateCall test is using the fixtures.updateConnectorBody. Let me check what's in the imports.js file to see the fixtures:
Assistant
Now let me examine the commands.js file to see how connectorUpdateCall is implemented:
Assistant
Let me look at the commands.js file differently by reading specific sections:
Assistant
(no content)
Assistant
Perfect! Now I can see the issue clearly. In the connectorUpdateCall function (lines 815-849), it's using the
updateConnectorBodydirectly from the fixture (line 836) without merging it properly with existing connector data. This causes the metadata to be completely replaced rather than merged, which breaks connectors that require certain metadata fields.Let me now examine the Braintree connector to understand what metadata is required:
Assistant
Let me check the required fields configuration for connectors:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.