diff --git a/app/components/Views/MultichainAccounts/AccountDetails/components/SmartAccount/SmartAccount.tsx b/app/components/Views/MultichainAccounts/AccountDetails/components/SmartAccount/SmartAccount.tsx index 1484f57eab5d..954768813d09 100644 --- a/app/components/Views/MultichainAccounts/AccountDetails/components/SmartAccount/SmartAccount.tsx +++ b/app/components/Views/MultichainAccounts/AccountDetails/components/SmartAccount/SmartAccount.tsx @@ -37,7 +37,7 @@ export const SmartAccountDetails = ({ account }: SmartAccountDetailsProps) => { } return ( - + { labelTextVariant={TextVariant.BodyMDMedium} label={} onPress={() => navigation.goBack()} + testID="smart-account-back-button" /> } > diff --git a/e2e/pages/wallet/SwitchAccountModal.ts b/e2e/pages/wallet/SwitchAccountModal.ts index 4046f57a88d7..34111e1c4e21 100644 --- a/e2e/pages/wallet/SwitchAccountModal.ts +++ b/e2e/pages/wallet/SwitchAccountModal.ts @@ -1,19 +1,43 @@ -import Matchers from '../../framework/Matchers.ts'; import Gestures from '../../framework/Gestures.ts'; +import Matchers from '../../framework/Matchers.ts'; import { SwitchAccountModalSelectorIDs } from '../../selectors/wallet/SwitchAccountModal.selectors.js'; class SwitchAccountModal { + get smartAccountLink(): DetoxElement { + return Matchers.getElementByID( + SwitchAccountModalSelectorIDs.SMART_ACCOUNT_LINK, + ); + } + get switchAccountButton(): DetoxElement { return Matchers.getElementByID( SwitchAccountModalSelectorIDs.SWITCH_ACCOUNT_BUTTON_LOCALHOST, ); } + get smartAccountBackButton(): DetoxElement { + return Matchers.getElementByID( + SwitchAccountModalSelectorIDs.SMART_ACCOUNT_BACK_BUTTON, + ); + } + async tapSwitchAccountButton(): Promise { await Gestures.waitAndTap(this.switchAccountButton, { checkEnabled: false, elemDescription: 'Switch Account button', }); } + + async tapSmartAccountLink(): Promise { + await Gestures.waitAndTap(this.smartAccountLink, { + elemDescription: 'Smart Account link', + }); + } + + async tapSmartAccountBackButton(): Promise { + await Gestures.waitAndTap(this.smartAccountBackButton, { + elemDescription: 'Smart Account back button', + }); + } } export default new SwitchAccountModal(); diff --git a/e2e/selectors/wallet/SwitchAccountModal.selectors.js b/e2e/selectors/wallet/SwitchAccountModal.selectors.js index 9b693b6493b2..657ea07ffd16 100644 --- a/e2e/selectors/wallet/SwitchAccountModal.selectors.js +++ b/e2e/selectors/wallet/SwitchAccountModal.selectors.js @@ -1,4 +1,6 @@ export const SwitchAccountModalSelectorIDs = { + SMART_ACCOUNT_BACK_BUTTON: 'smart-account-back-button', + SMART_ACCOUNT_LINK: 'smart-account-link', SWITCH_ACCOUNT_BUTTON: 'switch_account_button', SWITCH_ACCOUNT_BUTTON_LOCALHOST: 'switch_account_button-Localhost', }; diff --git a/e2e/specs/quarantine/batch-transaction.failing.ts b/e2e/specs/confirmations-redesigned/transactions/7702/batch-transaction.spec.ts similarity index 70% rename from e2e/specs/quarantine/batch-transaction.failing.ts rename to e2e/specs/confirmations-redesigned/transactions/7702/batch-transaction.spec.ts index 17a0d6773d73..0f017c658a17 100644 --- a/e2e/specs/quarantine/batch-transaction.failing.ts +++ b/e2e/specs/confirmations-redesigned/transactions/7702/batch-transaction.spec.ts @@ -1,28 +1,27 @@ -import AccountActionsBottomSheet from '../../pages/wallet/AccountActionsBottomSheet'; -import SwitchAccountModal from '../../pages/wallet/SwitchAccountModal'; -import AccountListBottomSheet from '../../pages/wallet/AccountListBottomSheet'; -import Assertions from '../../framework/Assertions'; -import Browser from '../../pages/Browser/BrowserView'; -import ConfirmationUITypes from '../../pages/Browser/Confirmations/ConfirmationUITypes'; -import FixtureBuilder from '../../framework/fixtures/FixtureBuilder'; -import FooterActions from '../../pages/Browser/Confirmations/FooterActions'; -import NetworkEducationModal from '../../pages/Network/NetworkEducationModal'; -import NetworkListModal from '../../pages/Network/NetworkListModal'; -import RowComponents from '../../pages/Browser/Confirmations/RowComponents'; -import TabBarComponent from '../../pages/wallet/TabBarComponent'; -import TestDApp from '../../pages/Browser/TestDApp'; -import WalletView from '../../pages/wallet/WalletView'; -import { SIMULATION_ENABLED_NETWORKS_MOCK } from '../../api-mocking/mock-responses/simulations'; -import { buildPermissions } from '../../framework/fixtures/FixtureUtils'; -import { loginToApp } from '../../viewHelper'; -import { SmokeConfirmationsRedesigned } from '../../tags'; -import { withFixtures } from '../../framework/fixtures/FixtureHelper'; -import { DappVariants } from '../../framework/Constants'; -import { AnvilNodeOptions, LocalNodeType } from '../../framework'; +import AccountDetails from '../../../../pages/MultichainAccounts/AccountDetails'; +import AccountListBottomSheet from '../../../../pages/wallet/AccountListBottomSheet'; +import Assertions from '../../../../framework/Assertions'; +import Browser from '../../../../pages/Browser/BrowserView'; +import ConfirmationUITypes from '../../../../pages/Browser/Confirmations/ConfirmationUITypes'; +import FixtureBuilder from '../../../../framework/fixtures/FixtureBuilder'; +import FooterActions from '../../../../pages/Browser/Confirmations/FooterActions'; +import NetworkListModal from '../../../../pages/Network/NetworkListModal'; +import RowComponents from '../../../../pages/Browser/Confirmations/RowComponents'; +import SwitchAccountModal from '../../../../pages/wallet/SwitchAccountModal'; +import TabBarComponent from '../../../../pages/wallet/TabBarComponent'; +import TestDApp from '../../../../pages/Browser/TestDApp'; +import WalletView from '../../../../pages/wallet/WalletView'; +import { SIMULATION_ENABLED_NETWORKS_MOCK } from '../../../../api-mocking/mock-responses/simulations'; +import { buildPermissions } from '../../../../framework/fixtures/FixtureUtils'; +import { loginToApp } from '../../../../viewHelper'; +import { SmokeConfirmationsRedesigned } from '../../../../tags'; +import { withFixtures } from '../../../../framework/fixtures/FixtureHelper'; +import { DappVariants } from '../../../../framework/Constants'; +import { AnvilNodeOptions, LocalNodeType } from '../../../../framework'; import { Mockttp } from 'mockttp'; -import { setupMockRequest } from '../../api-mocking/helpers/mockHelpers'; -import { confirmationsRedesignedFeatureFlags } from '../../api-mocking/mock-responses/feature-flags-mocks'; -import { setupRemoteFeatureFlagsMock } from '../../api-mocking/helpers/remoteFeatureFlagsHelper'; +import { setupMockRequest } from '../../../../api-mocking/helpers/mockHelpers'; +import { confirmationsRedesignedFeatureFlags } from '../../../../api-mocking/mock-responses/feature-flags-mocks'; +import { setupRemoteFeatureFlagsMock } from '../../../../api-mocking/helpers/remoteFeatureFlagsHelper'; const LOCAL_CHAIN_NAME = 'Localhost'; @@ -41,9 +40,6 @@ async function changeNetworkFromNetworkListModal() { await TabBarComponent.tapWallet(); await WalletView.tapNetworksButtonOnNavBar(); await NetworkListModal.changeNetworkTo(LOCAL_CHAIN_NAME); - await device.disableSynchronization(); - await NetworkEducationModal.tapGotItButton(); - await device.enableSynchronization(); } async function checkConfirmationPage() { @@ -55,10 +51,21 @@ async function checkConfirmationPage() { async function tapSwitchAccountModal() { await WalletView.tapIdenticon(); await AccountListBottomSheet.tapEditAccountActionsAtIndex(0); - await AccountActionsBottomSheet.tapSwitchToSmartAccount(); + await SwitchAccountModal.tapSmartAccountLink(); await SwitchAccountModal.tapSwitchAccountButton(); } +async function goBackToWalletPage() { + await SwitchAccountModal.tapSmartAccountBackButton(); + await AccountDetails.tapBackButton(); + try { + await AccountListBottomSheet.dismissAccountListModalV2(); + } catch (error) { + // Modal might already be dismissed, continue with test + console.log('Modal already dismissed or not found, continuing...'); + } +} + async function connectTestDappToLocalhost() { await TabBarComponent.tapBrowser(); await Browser.navigateToTestDApp(); @@ -110,7 +117,6 @@ describe(SmokeConfirmationsRedesigned('7702 - smart account'), () => { await loginToApp(); // Submit send calls - await TabBarComponent.tapWallet(); await changeNetworkFromNetworkListModal(); await connectTestDappToLocalhost(); await TestDApp.tapSendCallsButton(); @@ -149,6 +155,7 @@ describe(SmokeConfirmationsRedesigned('7702 - smart account'), () => { // Accept confirmation await FooterActions.tapConfirmButton(); + await goBackToWalletPage(); // Check activity tab await TabBarComponent.tapActivity(); await Assertions.expectTextDisplayed('Switch to standard account'); @@ -195,6 +202,7 @@ describe(SmokeConfirmationsRedesigned('7702 - smart account'), () => { // Accept confirmation await FooterActions.tapConfirmButton(); + await goBackToWalletPage(); // Check activity tab await TabBarComponent.tapActivity(); await Assertions.expectTextDisplayed('Upgrade to smart account');