Skip to content
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

test: Refactor WalletView file #10225

Merged
merged 13 commits into from
Jul 6, 2024
Merged

Conversation

SamuelSalas
Copy link
Contributor

@SamuelSalas SamuelSalas commented Jul 2, 2024

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

Related issues

Fixes: #1848

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

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

After

Pre-merge author checklist

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.

@SamuelSalas SamuelSalas requested review from a team as code owners July 2, 2024 22:28
@SamuelSalas SamuelSalas added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 357c8d1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3368ce78-51bf-4d58-80a5-94700c87dbd3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@SamuelSalas SamuelSalas added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 07af732
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/558e5890-c45c-4d8f-bba4-f8c0456cb4d1

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@SamuelSalas SamuelSalas added the QA Passed A successful QA run through has been done label Jul 4, 2024
@SamuelSalas SamuelSalas removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Jul 4, 2024
@chrisleewilcox chrisleewilcox added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: fa228d6
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6f005bce-7426-4528-9685-bdb0ed96cc0a

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarqubecloud bot commented Jul 5, 2024

Copy link
Contributor

@chrisleewilcox chrisleewilcox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SamuelSalas SamuelSalas merged commit b2cce87 into main Jul 6, 2024
34 of 35 checks passed
@SamuelSalas SamuelSalas deleted the test/1848-refactor-walletview branch July 6, 2024 22:14
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2024
@metamaskbot metamaskbot added the release-7.28.0 Issue or pull request that will be included in release 7.28.0 label Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Detox QA Passed A successful QA run through has been done release-7.28.0 Issue or pull request that will be included in release 7.28.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants