Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Refactor WalletView file (#10225)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Refactor the WalletView screen to follow the page object model as well as the current guidelines establish by the QA mobile team. As well to unify all the testIDs into one single object. ## **Summary** * app/component-library/components/Pickers/PickerAccount/PickerAccount.tsx: Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs.ACCOUNT_NAME_LABEL_TEXT` * app/component-library/components/Pickers/PickerNetwork/PickerNetwork.tsx: Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs.NAVBAR_NETWORK_TEXT ` * app/component-library/components/Toast/Toast.tsx: Remove previous `generateTestId ` with current testID `ToastSelectorsIDs.CONTAINER` * app/components/UI/AccountOverview/index.js: Remove `currentCurrency `, `newAssetTransaction `, `toggleReceiveModal ` props causing lint issues. Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs.ACCOUNT_ICON`, `WalletViewSelectorsIDs. ACCOUNT_NAME_LABEL_INPUT `, `WalletViewSelectorsIDs. ACCOUNT_NAME_LABEL_TEXT ` * app/components/UI/AddressCopy/AddressCopy.tsx: Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs.ACCOUNT_COPY_BUTTON`, `WalletViewSelectorsIDs. ACCOUNT_ADDRESS ` * app/components/UI/CollectibleContracts/index.js: Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs. IMPORT_NFT_BUTTON `, `WalletViewSelectorsIDs. NFT_TAB_CONTAINER ` * app/components/UI/Navbar/index.js: Remove previous `generateTestId ` with current testID `AddContactViewSelectorsIDs.EDIT_BUTTON `, `WalletViewSelectorsIDs.NAVBAR_NETWORK_BUTTON ` * app/components/UI/Tokens/index.test.tsx: Update `getByTestId ` with current testID `AddContactViewSelectorsIDs. IMPORT_TOKEN_BUTTON `, `WalletViewSelectorsIDs. TOKENS_CONTAINER ` * app/components/UI/Tokens/index.tsx: Remove previous `generateTestId ` with current testID `AddContactViewSelectorsIDs. IMPORT_TOKEN_BUTTON `, `WalletViewSelectorsIDs. TOKENS_CONTAINER ` * app/components/UI/WalletAccount/WalletAccount.test.tsx: Update `getByTestId ` with current testID `WalletViewSelectorsIDs.ACCOUNT_ADDRESS `, `WalletViewSelectorsIDs. ACCOUNT_COPY_BUTTON `, `WalletViewSelectorsIDs. ACCOUNT_ICON ` * app/components/UI/WalletAccount/WalletAccount.tsx: Remove previous `generateTestId ` with current testID `WalletViewSelectorsIDs.ACCOUNT_ADDRESS `, `WalletViewSelectorsIDs. ACCOUNT_COPY_BUTTON `, `WalletViewSelectorsIDs. ACCOUNT_ICON ` * app/components/Views/AccountActions/AccountActions.constants.ts: File removed * app/components/Views/AccountActions/AccountActions.test.tsx: Update `getByTestId ` with current testIDs from `AccountActionsModalSelectorsIDs` object. * app/components/Views/AccountActions/AccountActions.tsx: Remove previous `generateTestId ` with current testIDs from `AccountActionsModalSelectorsIDs ` object. * app/components/Views/TransactionsView/index.js: Remove `generateTestId` * app/components/Views/Wallet/index.test.tsx: Update `getByTestId ` with current testID `CommonSelectorsIDs.FOX_ICON `, `WalletViewSelectorsIDs.WALLET_SCAN_BUTTON` * app/components/Views/Wallet/index.tsx: Remove `generateTestId` * e2e/pages/Send/TransactionConfirmView.js: Remove `await` inside `Gestures.waitAndTap()` * e2e/pages/WalletView.js: File Relocated * e2e/pages/wallet/WalletView.js: File refactor to POM * e2e/selectors/Common.selectors.js: Add `ANDROID_PROGRESS_BAR` testId * e2e/selectors/Modals/AccountActionsModal.selectors.js: File created with already existing testIDs * e2e/selectors/TransactionConfirmView.selectors.js: Remove `eslint` exception line * e2e/selectors/wallet/WalletView.selectors.js: Added testIDs located in other files. * e2e/specs/accounts/create-wallet-account.spec.js: Update `pages/wallet/WalletView` file path. * e2e/specs/accounts/import-wallet-account.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/assets/import-tokens.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. Implement `WalletView.tokenInWallet()`. * e2e/specs/assets/nft-detection-modal.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/assets/token-detection-import-all.spec.js: Due to some inconsistencies when importing the wallet not showing the import token button, I decided to implement the fixture steps. * e2e/specs/confirmations/advanced-gas-fees.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. Remove await inside `await Assertions.checkIfVisible()` * e2e/specs/confirmations/approve-custom-erc20.spec.js: Update `Assertions. checkIfHasText()` to `Assertions. checkIfElementToHaveText()`. * e2e/specs/confirmations/increase-allowance-erc20.spec.js: Update `WalletView.checkIfHasText()` to `Assertions. checkIfElementToHaveText()`. * e2e/specs/networks/add-custom-rpc.spec.js: * e2e/specs/networks/connect-test-network.spec.js: Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. Update `Assertions. checkIfHasText()` to `Assertions. checkIfElementToHaveText()`. * e2e/specs/onboarding/onboarding-wizard-opt-in.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/permission-systems/permission-system-delete-wallet.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/quarantine/add-edit-custom-eth-mainnet.failing.js: Implement `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/quarantine/contract-nickname.failing.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. Implement `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/quarantine/deeplinks.failing.js: * e2e/specs/quarantine/import-nft.failing.js: Implement `Assertions.checkIfVisible()`. * e2e/specs/quarantine/permission-system-removing-imported-account.failing.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/settings/fiat-on-testnets.spec.js: Update `pages/wallet/WalletView` file path. Create `WalletView.totalBalance`. Update `Assertions. checkIfHasText()` to `Assertions. checkIfElementToHaveText()`. * e2e/specs/swaps/swap-token-chart.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/swaps/token-details.spec.js: Update `pages/wallet/WalletView` file path. * e2e/specs/wallet/portfolio-connect-account.spec.js: Update `pages/wallet/WalletView` file path. Update `Assertions. checkIfHasText()` to `Assertions. checkIfElementToHaveText()`. * e2e/specs/wallet/request-token-flow.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/wallet/send-ERC-token.spec.js: Update `pages/wallet/WalletView` file path. Update `WalletView.isVisible()` to `Assertions.checkIfVisible(WalletView.container)`. * e2e/specs/wallet/start-exploring.spec.js: Remove deprecated steps * e2e/utils/Assertions.js: Remove `checkIfHasText ` method. * e2e/viewHelper.js: Implement `Assertions.checkIfVisible()` for `WalletView` and `NetworkEducationModal `. Add `await Assertions.checkIfVisible(ToastModal.container)` steps * wdio/screen-objects/AddContact.js: Update testIDs to current implementation. * wdio/screen-objects/CommonScreen.js: Update testIDs to current implementation. * wdio/screen-objects/Modals/WalletAccountModal.js: Update testIDs to current implementation. * wdio/screen-objects/WalletMainScreen.js: Update testIDs to current implementation, fix naming issues. * wdio/screen-objects/testIDs/Common.testIds.js: File removed * wdio/screen-objects/testIDs/Screens/WalletView.testIds.js: Walletview testIDs moved to unify file <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: [#1848](MetaMask/mobile-planning#1848) ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> Smoke test: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/558e5890-c45c-4d8f-bba4-f8c0456cb4d1 Regression test: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/01e5fdff-34cf-4956-b54f-1588c4066139 ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
- Loading branch information