diff --git a/packages/wallets/src/metamask/metamask.page.ts b/packages/wallets/src/metamask/metamask.page.ts index 082c3bf3..9ae67f3e 100644 --- a/packages/wallets/src/metamask/metamask.page.ts +++ b/packages/wallets/src/metamask/metamask.page.ts @@ -78,21 +78,13 @@ export class MetamaskPage implements WalletPage { await this.navigate(); await this.header.networkListButton.click(); await this.header.networkList.clickToNetwork(networkName); - if (networkName === 'Linea Mainnet') { + if (networkName === 'Linea') { await this.popoverElements.closePopover(); //Linea network require additional confirmation } await this.page.close(); }); } - async switchNetwork(networkName = 'Linea Mainnet') { - await test.step(`Switch network to "${networkName}"`, async () => { - await this.navigate(); - await this.header.networkList.switchNetwork(networkName); - await this.page.close(); - }); - } - async setupNetwork(standConfig: Record) { await test.step(`Setup "${standConfig.chainName}" Network`, async () => { await this.header.networkListButton.click(); diff --git a/packages/wallets/src/okx/okx.page.ts b/packages/wallets/src/okx/okx.page.ts index 4c404de3..bb83064b 100644 --- a/packages/wallets/src/okx/okx.page.ts +++ b/packages/wallets/src/okx/okx.page.ts @@ -143,8 +143,9 @@ export class OkxPage implements WalletPage { * - switch in wallet extension * - switch in the connected dApp (switch in the extension doesn't switch the dApp network, but we do it to sync states) * */ - async switchNetwork(networkName: string) { + async changeNetwork(networkName: string) { await test.step(`Switch network to "${networkName}"`, async () => { + networkName = await checkNetworkName(networkName); await this.navigate(); // switch network for wallet @@ -157,10 +158,6 @@ export class OkxPage implements WalletPage { }); } - async changeNetwork(networkName: string) { - await this.switchNetwork(await checkNetworkName(networkName)); - } - /** To add new wallet address using wallet `privateKey` */ async importKey(key: string) { await this.navigate(); diff --git a/packages/wallets/src/wallet.page.ts b/packages/wallets/src/wallet.page.ts index c4c5e06a..e974edd5 100644 --- a/packages/wallets/src/wallet.page.ts +++ b/packages/wallets/src/wallet.page.ts @@ -28,7 +28,7 @@ export interface WalletPage { assertReceiptAddress(page: Page, expectedAmount: string): Promise; getWalletAddress?(): Promise; - switchNetwork?(networkName: string): Promise; + setupNetwork?(standConfig: Record): Promise; addNetwork(