Skip to content

Commit

Permalink
Update smart swap test scenario (#21889)
Browse files Browse the repository at this point in the history
## **Description**

Update smart swap test scenario because it works only on Etheruem
Mainnet, not with forks.

## **Related issues**



## **Manual testing steps**

Not necessary.

## **Screenshots/Recordings**


### **Before**


### **After**

## **Pre-merge author checklist**

- [X] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've clearly explained what problem this PR is solving and how it
is solved.
- [X] I've linked related issues
- [X] I've included manual testing steps
- [X] I've included screenshots/recordings if applicable
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [X] I’ve properly set the pull request status:
  - [X] In case it's not yet "ready for review", I've set it to "draft".
- [X] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [X] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [X] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
chloeYue committed Nov 23, 2023
1 parent 9afe693 commit 21c094f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
28 changes: 12 additions & 16 deletions test/scenarios/15. swap/smart swap.csv
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
Step,Test steps,Preconditions,Test data,Expected result,Notes
1,Open the extension.,,,The Welcome Back screen is shown.,
2,Proceed to Unlock the wallet.,,password (8 characters min).,"The Ether balance is shown on the overview. The wallet address is shown on the overview. The selected network is Ethereum Mainnet. ",
3,Login to Tenderly. Go to Forks tab in the left menu.,"Have a tenderly account. (If not, sign up on https://tenderly.co for a free version)",,,
4,"Click ""Fork a network"". Leave network field as default Mainnet, click ""Create"".",,,,
5,"Click ""Add RPC to MetaMask"". Proceed to add new network and switch to new network on MetaMask notification screen.",,,"The selected network is the fork of Ethereum Mainnet started in previous step. The Ether balance is shown on the overview. The wallet address is shown on the overview. ",Take a note of the wallet address.
6,"Go back to Tenderly, click ""Fund Accounts"". Enter wallet address we copied in previous step and click ""Submit"".",,,Wait a bit and see the balance on MeteMask has been funded with more Ether.,
7,"Click ""Swap"" button on MetaMask home screen.",,,Swap screen is shown. Default swap from currency is ETH. Settings button is shown.,
8,Click on settings button on swap screen. Turn on the smart swap toggle in settings.,The smart swap toggle initially was set to OFF.,,"Slippage tolerance section is displayed. User can choose between 2%, 3%, or enter a custom value.",
9,"In custom field, enter a percentage equals or higher than 5%.",,e.g. 8%,High slippage warning message is shown.,
10,"Click ""Update"" in settings.",,,Settings modal is closed.,
11,"On swap screen, enter a value for ETH that user wants to swap, then select a token to swap to.",,"e.g. 0.1 ETH to swap, and choose DAI to swap to",The amount for selected token user will obtain is displayed. Swap quote rate is shown. Estimated gas fee and max fee are shown. Included MetaMask fee is shown.,Take a note for the amount of selected token that user will obtain.
12,"Proceed to confirm swap. ",,,High slippage warning notification is shown.,
13,"Click ""Swap anyway"" to continue swap.",,,"After processing, transaction complete screen is shown.",
14,"Close the transaction complete screen. Go to tokens tab. ",,,The token we selected to swap to is displayed with the expected amount on tokens list.,
15,Go to MetaMask activity tab.,,,Swap transaction appears in the activity list. The swaped amount is shown in the activity list item.,
16,Open the activity list item.,,,"The status, recipient's address, nonce, amount, gas and total are shown in the item details.",
17,Expand the activity log for the transaction.,,,"The created, submitted and confirmed activities are shown in the activity log.",
18,Proceed to view the transaction on the block explorer.,,,The block explorer opens in a new tab.,
3,"Keep the selected network as Ethereum Mainnet. Click ""Swap"" button on MetaMask home screen.","Have funds on mainnet. (We can only test smart swap with real money on Ethereum Mainnet) ",,Swap screen is shown. Default swap from currency is ETH. Settings button is shown.,
4,Click on settings button on swap screen. Turn on the smart swap toggle in settings.,The smart swap toggle initially was set to OFF.,,"Slippage tolerance section is displayed. User can choose between 2%, 3%, or enter a custom value.",
5,"In custom field, enter a percentage equals or higher than 5%.",,e.g. 8%,High slippage warning message is shown.,
6,"Click ""Update"" in settings.",,,Settings modal is closed.,
7,"On swap screen, enter a value for ETH that user wants to swap, then select a token to swap to.",,"e.g. 0.1 ETH to swap, and choose DAI to swap to",The amount for selected token user will obtain is displayed. Swap quote rate is shown. Estimated gas fee and max fee are shown. Included MetaMask fee is shown.,Take a note for the amount of selected token that user will obtain.
8,"Proceed to confirm swap. ",,,High slippage warning notification is shown.,
9,"Click ""Swap anyway"" to continue swap.",,,"After processing, transaction complete screen is shown.",
10,"Close the transaction complete screen. Go to tokens tab. ",,,The token we selected to swap to is displayed with the expected amount on tokens list.,
11,Go to MetaMask activity tab.,,,Swap transaction appears in the activity list. The swapped amount is shown in the activity list item.,
12,Open the activity list item.,,,"The status, recipient's address, nonce, amount, gas and total are shown in the item details.",
13,Expand the activity log for the transaction.,,,"The created, submitted and confirmed activities are shown in the activity log.",
14,Proceed to view the transaction on the block explorer.,,,The block explorer opens in a new tab.,
2 changes: 1 addition & 1 deletion test/scenarios/15. swap/swap eth.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Step,Test steps,Preconditions,Test data,Expected result,Notes
9,"Close the settings modal. On swap screen, enter a value for ETH that user wants to swap, then select a token to swap to.",,"e.g. 0.1 ETH to swap, and choose DAI to swap to",The amount for selected token user will obtain is displayed. Swap quote rate is shown. Estimated gas fee and max fee are shown. Included MetaMask fee is shown.,Take a note for the amount of selected token that user will obtain.
10,Proceed to confirm swap.,,,"After processing, transaction complete screen is shown.",
11,"Close the transaction complete screen. Go to tokens tab. ",,,The token we selected to swap to is displayed with the expected amount on tokens list.,
12,Go to MetaMask activity tab.,,,Swap transaction appears in the activity list. The swaped amount is shown in the activity list item.,
12,Go to MetaMask activity tab.,,,Swap transaction appears in the activity list. The swapped amount is shown in the activity list item.,
13,Open the activity list item.,,,"The status, recipient's address, nonce, amount, gas and total are shown in the item details.",
14,Expand the activity log for the transaction.,,,"The created, submitted and confirmed activities are shown in the activity log.",
15,Proceed to view the transaction on the block explorer.,,,The block explorer opens in a new tab.,

0 comments on commit 21c094f

Please sign in to comment.