From 5850ee67aff8c59789c732efae229a81eced914f Mon Sep 17 00:00:00 2001 From: sleepytanya <104780023+sleepytanya@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:02:08 -0500 Subject: [PATCH] test: add scenario set custom spending cap for custom token (#23238) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **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](https://github.com/MetaMask/metamask-extension/issues/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 Co-authored-by: seaona <54408225+seaona@users.noreply.github.com> --- ...ign typed data v4 with hardware wallet.csv | 2 +- .../4. tokens/approve erc20 custom amount.csv | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/scenarios/4. tokens/approve erc20 custom amount.csv diff --git a/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv b/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv index e7a851260ecf..513de9fad813 100644 --- a/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv +++ b/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv @@ -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.", diff --git a/test/scenarios/4. tokens/approve erc20 custom amount.csv b/test/scenarios/4. tokens/approve erc20 custom amount.csv new file mode 100644 index 000000000000..ebc5b64185bc --- /dev/null +++ b/test/scenarios/4. tokens/approve erc20 custom amount.csv @@ -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.", \ No newline at end of file