Skip to content

Commit

Permalink
fix: some fixes to the process of network adding
Browse files Browse the repository at this point in the history
  • Loading branch information
jake4take committed Oct 28, 2024
1 parent 65b76c9 commit e0fb155
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/wallets/src/metamask/metamask.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,16 @@ export class MetamaskPage implements WalletPage {
isClosePage = false,
) {
await test.step(`Add new network "${networkName}"`, async () => {
await this.navigate();
await this.networkList.addNetworkManually(
networkName,
networkUrl,
chainId,
tokenSymbol,
blockExplorer,
);
if (isClosePage) await this.page.close();
});
if (isClosePage) await this.page.close();
}

async addPopularNetwork(networkName: string) {
Expand All @@ -154,7 +155,6 @@ export class MetamaskPage implements WalletPage {
await test.step(`Add popular network "${networkName}"`, async () => {
await this.networkList.networkDisplayCloseBtn.click();
await this.networkList.addPopularNetwork(networkName);
await this.popoverElements.switchToButton.click();
});
}
await this.page.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,19 @@ export class NetworkList {
.locator('../../..')
.locator('button:has-text("Add")')
.click();
// Without awaiting the button is not clickable
await this.page.waitForTimeout(500);
await new PopoverElements(this.page).approveAddNetworkButton.click();
await this.dialogSection.waitFor({ state: 'hidden' });
// Need to wait while the network to be added to the wallet
try {
await this.page
.getByText('Connecting to')
.waitFor({ state: 'visible', timeout: 5000 });
await this.page.getByText('Connecting to').waitFor({ state: 'hidden' });
} catch {
console.error('Connecting network was without loader');
}
});
}
}

0 comments on commit e0fb155

Please sign in to comment.