From 8a1c7137b1f48e9fd08c01a279a7e706a541896c Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 14:52:28 +0300 Subject: [PATCH 1/6] fix: fixed name of the Soneium testnet network --- package.json | 6 +++--- packages/wallets/src/okx/helper.ts | 1 + packages/wallets/src/okx/okx.page.ts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 46b4c3ea..b1a869ed 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,9 @@ "branches": [ "main", { - "name": "develop", - "channel": "alpha", - "prerelease": "alpha" + "name": "update-okx", + "channel": "alpha-update-okx", + "prerelease": "alpha-update-okx" } ] } diff --git a/packages/wallets/src/okx/helper.ts b/packages/wallets/src/okx/helper.ts index 52f63b6c..43a022d3 100644 --- a/packages/wallets/src/okx/helper.ts +++ b/packages/wallets/src/okx/helper.ts @@ -10,6 +10,7 @@ const incorrectNetworkNames = new Map([ ['Mantle Mainnet', 'Mantle'], ['Scroll Mainnet', 'Scroll'], ['Mode', 'Mode Network'], + ['Soneieum Testnet Minato', 'Soneieum Minato Testnet'], ]); const OkxIncludedNetwork = [ diff --git a/packages/wallets/src/okx/okx.page.ts b/packages/wallets/src/okx/okx.page.ts index 3b50bedc..375af91a 100644 --- a/packages/wallets/src/okx/okx.page.ts +++ b/packages/wallets/src/okx/okx.page.ts @@ -65,6 +65,7 @@ export class OkxPage implements WalletPage { await test.step('Navigate to OKX', async () => { await this.initLocators(); await this.goto(); + await this.page.waitForLoadState('load'); await this.loginPage.unlock(); await this.walletOperations.cancelAllTxInQueue(); }); From 25a941e9c8ab7198dcd7ad1a2397664dcdb126c9 Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 15:19:25 +0300 Subject: [PATCH 2/6] fix: fixed name of the Soneium testnet network --- packages/wallets/src/okx/helper.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/wallets/src/okx/helper.ts b/packages/wallets/src/okx/helper.ts index 43a022d3..7530b7c0 100644 --- a/packages/wallets/src/okx/helper.ts +++ b/packages/wallets/src/okx/helper.ts @@ -10,7 +10,7 @@ const incorrectNetworkNames = new Map([ ['Mantle Mainnet', 'Mantle'], ['Scroll Mainnet', 'Scroll'], ['Mode', 'Mode Network'], - ['Soneieum Testnet Minato', 'Soneieum Minato Testnet'], + ['Soneium Testnet Minato', 'Soneium Minato Testnet'], ]); const OkxIncludedNetwork = [ @@ -24,6 +24,7 @@ const OkxIncludedNetwork = [ 'Scroll', 'Mode Network', 'Zircuit', + 'Soneium Minato Testnet', ]; /** Check network name and return correct name suited for OKX Wallet*/ @@ -45,6 +46,6 @@ export async function closeUnnecessaryPages(browserContext: BrowserContext) { /** Before AddNetwork() we check the network is included in wallet or not*/ export async function isNeedAddNetwork(network: string) { - const networkName = await getCorrectNetworkName(network); + const networkName = getCorrectNetworkName(network); return !OkxIncludedNetwork.includes(networkName); } From fcefd9a3352d67a4a57666dd3cd26740a42a0112 Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 15:25:27 +0300 Subject: [PATCH 3/6] fix: added Avalanche network to OKX --- packages/wallets/src/okx/helper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/wallets/src/okx/helper.ts b/packages/wallets/src/okx/helper.ts index 7530b7c0..2bd05d90 100644 --- a/packages/wallets/src/okx/helper.ts +++ b/packages/wallets/src/okx/helper.ts @@ -11,6 +11,7 @@ const incorrectNetworkNames = new Map([ ['Scroll Mainnet', 'Scroll'], ['Mode', 'Mode Network'], ['Soneium Testnet Minato', 'Soneium Minato Testnet'], + ['Avalanche Network C-Chain', 'Avalanche C'], ]); const OkxIncludedNetwork = [ @@ -25,6 +26,7 @@ const OkxIncludedNetwork = [ 'Mode Network', 'Zircuit', 'Soneium Minato Testnet', + 'Avalanche C', ]; /** Check network name and return correct name suited for OKX Wallet*/ From c3cb075a8048185ebc5daaf57ca6efe816c8efaa Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 15:31:23 +0300 Subject: [PATCH 4/6] fix: added locator to OKX confirm process --- packages/wallets/src/okx/pages/walletOperations.page.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/wallets/src/okx/pages/walletOperations.page.ts b/packages/wallets/src/okx/pages/walletOperations.page.ts index 0ac141dd..f95c16d5 100644 --- a/packages/wallets/src/okx/pages/walletOperations.page.ts +++ b/packages/wallets/src/okx/pages/walletOperations.page.ts @@ -13,7 +13,9 @@ export class WalletOperations { constructor(public page: Page) { this.connectButton = this.page.locator('button:has-text("Connect")'); - this.confirmTxButton = this.page.locator('button:has-text("Confirm")'); + this.confirmTxButton = this.page + .locator('button:has-text("Confirm")') + .or(this.page.locator('button:has-text("Continue on this network")')); // OKX displays this button if it doubts the reliability this.cancelTxButton = this.page.locator('button:has-text("Cancel")'); this.rejectTxButton = this.page.locator('button:has-text("Reject")'); this.txYouPayBlock = this.page From 6ed7de2831adeb41217567673cab3a527c1b1b0b Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 15:46:41 +0300 Subject: [PATCH 5/6] fix: wait for page is closed after tx canceling --- packages/wallets/src/okx/okx.page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/wallets/src/okx/okx.page.ts b/packages/wallets/src/okx/okx.page.ts index 375af91a..24667c75 100644 --- a/packages/wallets/src/okx/okx.page.ts +++ b/packages/wallets/src/okx/okx.page.ts @@ -193,6 +193,7 @@ export class OkxPage implements WalletPage { async cancelTx(page: Page) { await test.step('Cancel TX', async () => { await new WalletOperations(page).cancelTxButton.click(); + await page.waitForEvent('close', { timeout: 30000 }); }); } From 4f5520ca5eb2f1c025d1171de250cae6516b80ae Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 6 Aug 2025 17:14:01 +0300 Subject: [PATCH 6/6] fix: added await for okx page is loaded --- packages/wallets/src/okx/okx.page.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/wallets/src/okx/okx.page.ts b/packages/wallets/src/okx/okx.page.ts index 24667c75..2d70d020 100644 --- a/packages/wallets/src/okx/okx.page.ts +++ b/packages/wallets/src/okx/okx.page.ts @@ -65,7 +65,15 @@ export class OkxPage implements WalletPage { await test.step('Navigate to OKX', async () => { await this.initLocators(); await this.goto(); - await this.page.waitForLoadState('load'); + + await test.step('Wait for page is loaded', async () => { + await this.page.waitForLoadState('load'); + if (await this.page.getByRole('img', { name: 'okx' }).isVisible()) + await this.page + .getByRole('img', { name: 'okx' }) + .waitFor({ state: 'hidden', timeout: 30000 }); + }); + await this.loginPage.unlock(); await this.walletOperations.cancelAllTxInQueue(); });