-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
test: Add e2e test for gas less swap #23507
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
base: main
Are you sure you want to change the base?
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| jest.setTimeout(120000); | ||
| }); | ||
|
|
||
| it('should complete swap ETH to MUSD with gas included', async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Test name uses prohibited "should" prefix (Bugbot Rules)
The test name 'should complete swap ETH to MUSD with gas included' uses the prohibited "should" prefix. According to the E2E testing guidelines, test names must not use "should" - this is a hard rule with zero exceptions. The test name needs to be action-oriented, such as 'completes swap ETH to MUSD with gas included'.
| await WalletView.tapWalletSwapButton(); | ||
| await device.disableSynchronization(); | ||
| await Assertions.expectElementToBeVisible(QuoteView.selectAmountLabel, { | ||
| description: 'Swap amount selection should be visible', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Assertion descriptions use prohibited "should" phrasing (Bugbot Rules)
Multiple assertion description parameters use "should" phrasing (lines 78, 87, 92, 97, 104, 112), such as 'Swap amount selection should be visible'. According to the testing guidelines, descriptions need to use action-oriented language without "should", for example 'Swap amount selection is visible' or 'Network fee label visible'.
Additional Locations (2)
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes are entirely within the E2E test infrastructure for swap functionality:
These changes:
Running |
| jest.setTimeout(120000); | ||
| }); | ||
|
|
||
| it('should complete swap ETH to MUSD with gas included', async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Test name uses prohibited "should" prefix (Bugbot Rules)
The test name 'should complete swap ETH to MUSD with gas included' violates the E2E testing guidelines which explicitly prohibit using the prefix "should" in test names. Per the guidelines, the name could be something like 'completes swap ETH to MUSD with gas included' instead. This was also flagged in the PR discussion by @chrisleewilcox.
| metadata: { storage: {} }, | ||
| }, | ||
| destTokenAmount: '3011431', | ||
| minDestTokenAmount: '3759291202', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Mock data has inverted token amount values
The mock data GASLESS_SWAP_QUOTES_ETH_MUSD has destTokenAmount: '3011431' which is smaller than minDestTokenAmount: '3759291202'. This is logically backwards—the minimum received amount after slippage cannot be greater than the expected destination amount. All other quote mocks in the codebase correctly have destTokenAmount larger than minDestTokenAmount. This could cause incorrect behavior when testing UI elements that rely on these values.
|
| ], | ||
| testSpecificMock: async (mockServer) => { | ||
| // Mock ETH->MUSD quote (gasless swap) | ||
| await setupMockRequest(mockServer, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the /getQuote call but I don't see any mock for the calls that are done after the swap is submitted. How does it work?



Description
Add e2e test for the gas less swap
Changelog
CHANGELOG entry: null
Related issues
Fixes:
https://consensyssoftware.atlassian.net/browse/MMQA-1178
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds an e2e test for gasless ETH→MUSD swap, with new selectors and page actions to tap Max and verify “Included” network fee, plus mock quote data.
e2e/specs/swaps/gasless-swap-crosschain.spec.tsto validate gasless ETH→MUSD swap flow:Max, verifiesNetwork feeshowsIncluded, confirms swap, and asserts activity status is confirmed.e2e/pages/swaps/QuoteView.ts:maxLink,includedLabelgetters andtapMax()action.e2e/selectors/swaps/QuoteView.selectors.ts:MAXandINCLUDED.e2e/specs/swaps/helpers/constants.ts: addGASLESS_SWAP_QUOTES_ETH_MUSDmock response.setupMockRequest.Written by Cursor Bugbot for commit 957c2dd. This will update automatically on new commits. Configure here.