diff --git a/.circleci/config.yml b/.circleci/config.yml index 3178a687a617..4c3c0c5e69c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -172,7 +172,6 @@ workflows: requires: - prep-deps - prep-build-test-flask-mv2: - <<: *develop_master_rc_only requires: - prep-deps - prep-build-test-mmi: @@ -200,7 +199,6 @@ workflows: requires: - prep-deps - test-e2e-chrome-webpack: - <<: *develop_master_rc_only requires: - prep-build-test-webpack - get-changed-files-with-git-diff @@ -209,7 +207,6 @@ workflows: - prep-build-test - get-changed-files-with-git-diff - test-e2e-firefox: - <<: *develop_master_rc_only requires: - prep-build-test-mv2 - get-changed-files-with-git-diff @@ -229,7 +226,6 @@ workflows: - prep-build-test-flask - get-changed-files-with-git-diff - test-e2e-firefox-flask: - <<: *develop_master_rc_only requires: - prep-build-test-flask-mv2 - test-e2e-chrome-mmi: diff --git a/test/e2e/page-objects/pages/home/asset-list.ts b/test/e2e/page-objects/pages/home/asset-list.ts index 0fb9eb0ee279..d7308974abe8 100644 --- a/test/e2e/page-objects/pages/home/asset-list.ts +++ b/test/e2e/page-objects/pages/home/asset-list.ts @@ -70,9 +70,7 @@ class AssetListPage { } async clickOnAsset(assetName: string): Promise { - const buttons = await this.driver.findElements( - '[data-testid="multichain-token-list-button"]', - ); + const buttons = await this.driver.findElements(this.tokenLisiItem); for (const button of buttons) { const text = await button.getText(); if (text.includes(assetName)) { @@ -108,6 +106,12 @@ class AssetListPage { return text; } + async getNumberOfAssets(): Promise { + console.log(`Returning the total number of asset items in the token list`); + const assets = await this.driver.findElements(this.tokenLisiItem); + return assets.length; + } + /** * Hides a token by clicking on the token name, and confirming the hide modal. * @@ -188,9 +192,7 @@ class AssetListPage { } async check_ifAssetIsVisible(assetName: string): Promise { - const assets = await this.driver.findElements( - '[data-testid="multichain-token-list-button"]', - ); + const assets = await this.driver.findElements(this.tokenLisiItem); for (const asset of assets) { const text = await asset.getText(); if (text.includes(assetName)) { @@ -255,8 +257,8 @@ class AssetListPage { async check_tokenItemNumber(expectedNumber: number = 1): Promise { console.log(`Waiting for ${expectedNumber} token items to be displayed`); await this.driver.wait(async () => { - const tokenItems = await this.driver.findElements(this.tokenLisiItem); - return tokenItems.length === expectedNumber; + const tokenItemsNumber = await this.getNumberOfAssets(); + return tokenItemsNumber === expectedNumber; }, 10000); console.log( `Expected number of token items ${expectedNumber} is displayed.`, diff --git a/test/e2e/tests/confirmations/transactions/nft-token-send-redesign.spec.ts b/test/e2e/tests/confirmations/transactions/nft-token-send-redesign.spec.ts index bfc226501636..09bd9d4b32a2 100644 --- a/test/e2e/tests/confirmations/transactions/nft-token-send-redesign.spec.ts +++ b/test/e2e/tests/confirmations/transactions/nft-token-send-redesign.spec.ts @@ -11,6 +11,7 @@ import WatchAssetConfirmation from '../../../page-objects/pages/confirmations/le import TokenTransferTransactionConfirmation from '../../../page-objects/pages/confirmations/redesign/token-transfer-confirmation'; import TransactionConfirmation from '../../../page-objects/pages/confirmations/redesign/transaction-confirmation'; import HomePage from '../../../page-objects/pages/home/homepage'; +import NFTListPage from '../../../page-objects/pages/home/nft-list'; import NFTDetailsPage from '../../../page-objects/pages/nft-details-page'; import SendTokenPage from '../../../page-objects/pages/send/send-token-page'; import TestDapp from '../../../page-objects/pages/test-dapp'; @@ -206,9 +207,8 @@ async function createERC721WalletInitiatedTransactionAndAssertDetails( await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); - const homePage = new HomePage(driver); - await homePage.goToNftTab(); - await homePage.clickNFTIconOnActivityList(); + await new HomePage(driver).goToNftTab(); + await new NFTListPage(driver).clickNFTIconOnActivityList(); const nftDetailsPage = new NFTDetailsPage(driver); await nftDetailsPage.clickNFTSendButton(); @@ -295,9 +295,8 @@ async function createERC1155WalletInitiatedTransactionAndAssertDetails( await watchAssetConfirmation.clickFooterConfirmButton(); await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); - const homePage = new HomePage(driver); - await homePage.goToNftTab(); - await homePage.clickNFTIconOnActivityList(); + await new HomePage(driver).goToNftTab(); + await new NFTListPage(driver).clickNFTIconOnActivityList(); const nftDetailsPage = new NFTDetailsPage(driver); await nftDetailsPage.clickNFTSendButton(); diff --git a/test/e2e/tests/multichain/aggregated-balances.spec.ts b/test/e2e/tests/multichain/aggregated-balances.spec.ts index 1432d10ec77e..5e99c2e909e7 100644 --- a/test/e2e/tests/multichain/aggregated-balances.spec.ts +++ b/test/e2e/tests/multichain/aggregated-balances.spec.ts @@ -118,7 +118,7 @@ describe('Multichain Aggregated Balances', function (this: Suite) { EXPECTED_SEPOLIA_BALANCE_NATIVE, SEPOLIA_NATIVE_TOKEN, ); - await assetListPage.checkNetworkFilterText(NETWORK_NAME_SEPOLIA); + await assetListPage.check_networkFilterText(NETWORK_NAME_SEPOLIA); // Step 11: Enable fiat display on testnets in settings await headerNavbar.openSettingsPage(); diff --git a/test/e2e/tests/tokens/add-hide-token.spec.ts b/test/e2e/tests/tokens/add-hide-token.spec.ts index e3731bac5352..f6d21430cd18 100644 --- a/test/e2e/tests/tokens/add-hide-token.spec.ts +++ b/test/e2e/tests/tokens/add-hide-token.spec.ts @@ -1,7 +1,7 @@ import { toHex } from '@metamask/controller-utils'; import { withFixtures } from '../../helpers'; import FixtureBuilder from '../../fixture-builder'; -import HomePage from '../../page-objects/pages/home/homepage'; +import AssetListPage from '../../page-objects/pages/home/asset-list'; import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow'; describe('Add hide token', function () { @@ -38,12 +38,12 @@ describe('Add hide token', function () { }, async ({ driver }) => { await loginWithBalanceValidation(driver); - const homepage = new HomePage(driver); - await homepage.check_tokenItemNumber(2); - await homepage.check_tokenAmountIsDisplayed('0 TST'); + const assetListPage = new AssetListPage(driver); + await assetListPage.check_tokenItemNumber(2); + await assetListPage.check_tokenAmountIsDisplayed('0 TST'); - await homepage.hideToken('TST'); - await homepage.check_tokenItemNumber(1); + await assetListPage.hideToken('TST'); + await assetListPage.check_tokenItemNumber(1); }, ); }); diff --git a/test/e2e/tests/tokens/add-token-using-search.ts b/test/e2e/tests/tokens/add-token-using-search.ts index ce9eec58f8da..c1ae188a39b9 100644 --- a/test/e2e/tests/tokens/add-token-using-search.ts +++ b/test/e2e/tests/tokens/add-token-using-search.ts @@ -2,7 +2,7 @@ import { MockedEndpoint, Mockttp } from 'mockttp'; import { defaultGanacheOptions, withFixtures } from '../../helpers'; import FixtureBuilder from '../../fixture-builder'; import { CHAIN_IDS } from '../../../../shared/constants/network'; -import HomePage from '../../page-objects/pages/home/homepage'; +import AssetListPage from '../../page-objects/pages/home/asset-list'; import { loginWithoutBalanceValidation } from '../../page-objects/flows/login.flow'; describe('Add existing token using search', function () { @@ -56,10 +56,10 @@ describe('Add existing token using search', function () { }, async ({ driver }) => { await loginWithoutBalanceValidation(driver); - const homepage = new HomePage(driver); - await homepage.check_tokenAmountIsDisplayed('25 BNB'); - await homepage.importTokenBySearch('BAT'); - await homepage.check_tokenAmountInTokenDetailsModal( + const assetListPage = new AssetListPage(driver); + await assetListPage.check_tokenAmountIsDisplayed('25 BNB'); + await assetListPage.importTokenBySearch('BAT'); + await assetListPage.check_tokenAmountInTokenDetailsModal( 'Basic Attention Token', '0 BAT', ); diff --git a/test/e2e/tests/tokens/nft/auto-detect-nft.spec.ts b/test/e2e/tests/tokens/nft/auto-detect-nft.spec.ts index a248132d57b5..a1bc9005a2f3 100644 --- a/test/e2e/tests/tokens/nft/auto-detect-nft.spec.ts +++ b/test/e2e/tests/tokens/nft/auto-detect-nft.spec.ts @@ -2,6 +2,7 @@ import { withFixtures } from '../../../helpers'; import FixtureBuilder from '../../../fixture-builder'; import HeaderNavbar from '../../../page-objects/pages/header-navbar'; import Homepage from '../../../page-objects/pages/home/homepage'; +import NFTListPage from '../../../page-objects/pages/home/nft-list'; import PrivacySettings from '../../../page-objects/pages/settings/privacy-settings'; import SettingsPage from '../../../page-objects/pages/settings/settings-page'; import { loginWithBalanceValidation } from '../../../page-objects/flows/login.flow'; @@ -39,10 +40,11 @@ describe('NFT detection', function () { await homepage.check_pageIsLoaded(); await homepage.check_expectedBalanceIsDisplayed(); await homepage.goToNftTab(); - await homepage.check_nftNameIsDisplayed( + const nftListPage = new NFTListPage(driver); + await nftListPage.check_nftNameIsDisplayed( 'ENS: Ethereum Name Service (1)', ); - await homepage.check_nftImageIsDisplayed(); + await nftListPage.check_nftImageIsDisplayed(); }, ); }); diff --git a/test/e2e/tests/tokens/watch-asset-call-add-token.ts b/test/e2e/tests/tokens/watch-asset-call-add-token.ts index 543ca5dea3eb..b1dc4ae98746 100644 --- a/test/e2e/tests/tokens/watch-asset-call-add-token.ts +++ b/test/e2e/tests/tokens/watch-asset-call-add-token.ts @@ -6,7 +6,7 @@ import { import FixtureBuilder from '../../fixture-builder'; import { SMART_CONTRACTS } from '../../seeder/smart-contracts'; import AddTokenConfirmation from '../../page-objects/pages/confirmations/redesign/add-token-confirmations'; -import HomePage from '../../page-objects/pages/home/homepage'; +import AssetListPage from '../../page-objects/pages/home/asset-list'; import TestDapp from '../../page-objects/pages/test-dapp'; import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow'; @@ -55,7 +55,7 @@ describe('Add token using wallet_watchAsset', function () { await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); - await new HomePage(driver).check_tokenAmountIsDisplayed('0 TST'); + await new AssetListPage(driver).check_tokenAmountIsDisplayed('0 TST'); }, ); }); @@ -102,7 +102,7 @@ describe('Add token using wallet_watchAsset', function () { await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); - await new HomePage(driver).check_tokenItemNumber(1); + await new AssetListPage(driver).check_tokenItemNumber(1); }, ); });