Skip to content

Commit

Permalink
test: add scenario set custom spending cap for custom token (#23238)
Browse files Browse the repository at this point in the history
## **Description**


In this PR we add the scenario for the flow 'Set custom spending cap for
custom token'.
This task belongs to the effort of documenting manual QA flows in this
[Epic](#21962).


## **Related issues**

Fixes: #22411 

## **Manual testing steps**

1. Verify that the test steps align with the sequence in the video.
You can find rendered table
[here](https://github.com/MetaMask/metamask-extension/blob/66de2251a266cd1b5d97901a826624dbb378ad03/test/scenarios/4.%20tokens/approve%20custom%20erc20%20amount.csv).



## **Screenshots/Recordings**



https://github.com/MetaMask/metamask-extension/assets/104780023/3fc47750-fc3f-4346-a81b-10427dda1dd3


## **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:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] 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.

---------

Co-authored-by: seaona <[email protected]>
Co-authored-by: seaona <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2024
1 parent 7fea26d commit 5850ee6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Steps,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.
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.",
3,"Click on account menu icon. Click ""Add account or hardware wallet"".",,,"The ""Add account"" modal is shown.",
4,"On ""Add account"" modal, click ""Add hardware wallet"" button.",,,"""Connect a hardware wallet"" screen is shown. User can choose between different options to connect a hardware: Ledger, Trezor, Lattice, or QR-based. ""Continue"" button is disabled.",
Expand Down
22 changes: 22 additions & 0 deletions test/scenarios/4. tokens/approve erc20 custom amount.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Steps,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.",
3,Switch networks to a test network.,,e. g. Sepolia,The Sepolia balance is shown on the overview. The wallet address is shown on the overview. The selected network is Sepolia.,
4,Open the test dapp in another tab.,,https://metamask.github.io/test-dapp/,,
5,"Click ""Connect"".",,,"The MetaMask popup is opened with the ""Connect with MetaMask"" screen displayed.
Your wallet account is selected.",
6,"Click ""Next"" and connect with the wallet account.",,,"The MetaMask popup is closed.
You are connected to the test dapp.",
7,"Click ""Create token"" to deploy a token contract.",,,The info modal with contract deployment fees is displayed.,
8,"Click ""Confirm"" and wait for the contract deployment transaction to be confirmed.",,,The MetaMask popup is closed.,Custom token contract deployment time can vary for different networks.
9,"Switch to the MetaMask wallet and click on the latest transaction in the ""Activity"" tab.",,,"The contract deployment transaction status, nonce, amount, gas and total fees are shown in the transaction details.",
10,"Click on ""View on block explorer"" in the transaction details modal.",,,The block explorer opens in a new tab.,
11,Switch to the test dapp in another tab.,,," ""Approve tokens"" button is active.",
12,"Click ""Approve tokens"".",,,"The MetaMask popup with the request for setting a spending cap on the tokens will appear. Within the 'Custom Spending Cap' field, a value of ""7"" is displayed.",
13,"Remove the value of ""7"" and enter ""2"" as the new custom spending cap.",,,"""2"" is shown in the ""Custom Spending Cap"" field on the MetaMask popup.",
14,"Click ""Next"".",,,"The MetaMask popup with the request for a spending cap for ""2"" tokens and estimated gas fees will appear.",
15,"Click ""Approve"".",,,The Metamask popup is closed.,
16,"Switch to the MetaMask ""Activity"" tab.",,,"""Approve TST spending cap"" transaction is displayed as ""Pending"" in the ""Activity"" tab.",
17,"Wait for the transaction status change to 'Confirmed"".",,,"""Approve TST spending cap"" transaction is displayed as ""Confirmed"" in the ""Activity"" tab.",
18,Proceed to view the transaction on block explorer.,,,"Click on ""View on block explorer"" in the transaction details modal. The block explorer opens in a new tab.",

0 comments on commit 5850ee6

Please sign in to comment.