Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SmartAccountDetails = ({ account }: SmartAccountDetailsProps) => {
}

return (
<TouchableOpacity onPress={onSmartAccountPress}>
<TouchableOpacity onPress={onSmartAccountPress} testID="smart-account-link">
<Box
style={styles.container}
flexDirection={FlexDirection.Row}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const SmartAccountModal = () => {
labelTextVariant={TextVariant.BodyMDMedium}
label={<Icon name={IconName.ArrowLeft} size={IconSize.Md} />}
onPress={() => navigation.goBack()}
testID="smart-account-back-button"
/>
}
>
Expand Down
26 changes: 25 additions & 1 deletion e2e/pages/wallet/SwitchAccountModal.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
await Gestures.waitAndTap(this.switchAccountButton, {
checkEnabled: false,
elemDescription: 'Switch Account button',
});
}

async tapSmartAccountLink(): Promise<void> {
await Gestures.waitAndTap(this.smartAccountLink, {
elemDescription: 'Smart Account link',
});
}

async tapSmartAccountBackButton(): Promise<void> {
await Gestures.waitAndTap(this.smartAccountBackButton, {
elemDescription: 'Smart Account back button',
});
}
}

export default new SwitchAccountModal();
2 changes: 2 additions & 0 deletions e2e/selectors/wallet/SwitchAccountModal.selectors.js
Original file line number Diff line number Diff line change
@@ -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',
};
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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() {
Expand All @@ -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();
Expand Down Expand Up @@ -110,7 +117,6 @@ describe(SmokeConfirmationsRedesigned('7702 - smart account'), () => {
await loginToApp();

// Submit send calls
await TabBarComponent.tapWallet();
await changeNetworkFromNetworkListModal();
await connectTestDappToLocalhost();
await TestDApp.tapSendCallsButton();
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@
}
}
},
"best_block_number": "0x4",
"best_block_number": 4,
"block": {
"number": "0x4",
"number": 4,
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x67e150f4",
"gas_limit": "0x1c9c380",
"basefee": "0x2d81f0ba",
"gas_limit": 30000000,
"basefee": 763490490,
"difficulty": "0x0",
"prevrandao": "0x76d5ccfe10566cec19b4cb071969bfb3b3f7ae18b8f5e23d9c3056505c8128a2",
"blob_excess_gas_and_price": { "excess_blob_gas": 0, "blob_gasprice": 1 }
Expand All @@ -242,7 +242,7 @@
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x0",
"number": "0x2",
"gasLimit": "0x1c9c380",
"gasLimit": 30000000,
"gasUsed": "0x5acf3c",
"timestamp": "0x67e150f4",
"extraData": "0x",
Expand Down Expand Up @@ -290,14 +290,14 @@
"receiptsRoot": "0x13f38bfac4f328a7b8287f747295102524cbba6fcb7508ac5f41cf7a89540707",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x0",
"number": "0x4",
"gasLimit": "0x1c9c380",
"number": 4,
"gasLimit": 30000000,
"gasUsed": "0x143b63",
"timestamp": "0x67e150f4",
"extraData": "0x",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x2d81f0ba",
"baseFeePerGas": 763490490,
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"excessBlobGas": "0x0",
Expand Down Expand Up @@ -340,7 +340,7 @@
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x0",
"number": "0x0",
"gasLimit": "0x1c9c380",
"gasLimit": 30000000,
"gasUsed": "0x0",
"timestamp": "0x67e150f2",
"extraData": "0x",
Expand All @@ -367,7 +367,7 @@
"logsBloom": "0x00000000000000000000002000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000810000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000000008000000000000000000000000800000001400000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040",
"difficulty": "0x0",
"number": "0x3",
"gasLimit": "0x1c9c380",
"gasLimit": 30000000,
"gasUsed": "0x40f07f",
"timestamp": "0x67e150f4",
"extraData": "0x",
Expand Down Expand Up @@ -416,7 +416,7 @@
"logsBloom": "0x00000000000000000002000000000000000000004000000000800000004000000000000000000000000000000000000000000000000000000000001000000020000000000000000000000000000000000001000000000020000000000000000000000800020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000080000000000000001000000000000000000000000000800000000000000000000000000000000000000000000000000000000008040001000000000000000000000000000000000000200000020000000000000000000000000000000000001000000000000000000000000000000",
"difficulty": "0x0",
"number": "0x1",
"gasLimit": "0x1c9c380",
"gasLimit": 30000000,
"gasUsed": "0x3a8613",
"timestamp": "0x67e150f3",
"extraData": "0x",
Expand Down
Loading