Skip to content

Commit

Permalink
Merge pull request #171 from lidofinance/fix-coin98
Browse files Browse the repository at this point in the history
fix: coin98 pop-up && account selection
  • Loading branch information
itaven authored Jul 11, 2024
2 parents 53d7e44 + a0a19f6 commit 3fbfd2b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/wallets/src/coin98/coin98.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class Coin98 implements WalletPage {
);
await this.page.reload();
await this.page.waitForTimeout(1000);
await this.closePopover(this.page);
});
}

Expand Down Expand Up @@ -73,16 +74,34 @@ export class Coin98 implements WalletPage {
async connectWallet(page: Page) {
await test.step('Connect wallet', async () => {
await this.unlock(page);
const selectAllBtn = page.getByText('Select all');
// for polygon network there is no account selection preview
if (await selectAllBtn.isVisible()) {
await selectAllBtn.click();
await page.click('button:has-text("Confirm")');
}

await page.click('button:has-text("Connect")');
});
}
async closePopover(popUpPage: Page) {
//popUpPage param required since noisy pop-up can appear in confirmation pages
try {
const popoverContent = popUpPage.locator('button:has-text("Try now")');
await popoverContent.waitFor({ state: 'visible', timeout: 2000 });
await popoverContent.click();
} catch (error) {
return;
}
}

async unlock(page: Page) {
await test.step('Unlock', async () => {
await page.waitForSelector('input[name="password"]');
if ((await page.locator('input[name="password"]').count()) > 0) {
await page.fill('input[name=password]', this.config.PASSWORD);
await page.click('text=Unlock Wallet');
await this.closePopover(page);
}
});
}
Expand Down

0 comments on commit 3fbfd2b

Please sign in to comment.