From e59bfe7017905d4ad9400e2a7f183ee65fe2b40a Mon Sep 17 00:00:00 2001 From: itaven Date: Thu, 14 Dec 2023 00:26:57 +0500 Subject: [PATCH] fix: eth widget locators --- packages/widgets/src/ethereum/ethereum.page.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/widgets/src/ethereum/ethereum.page.ts b/packages/widgets/src/ethereum/ethereum.page.ts index 5b81004d..943a42fc 100644 --- a/packages/widgets/src/ethereum/ethereum.page.ts +++ b/packages/widgets/src/ethereum/ethereum.page.ts @@ -26,16 +26,11 @@ export class EthereumPage implements WidgetPage { async () => { await this.page.waitForTimeout(2000); const isConnected = - (await this.page - .locator("button :has-text('Connect wallet')") - .count()) === 0; + (await this.page.getByTestId('connectBtn').count()) === 0; if (!isConnected) { - await this.page - .locator("button :has-text('Connect wallet')") - .first() - .click(); + await this.page.getByTestId('connectBtn').first().click(); await this.page.waitForTimeout(2000); - if ((await this.page.locator('text=Submit').count()) === 0) { + if ((await this.page.getByTestId('stakeSubmitBtn').count()) === 0) { if (!(await this.page.isChecked('input[type=checkbox]'))) await this.page.click('input[type=checkbox]', { force: true }); if (walletPage.config.COMMON.SIMPLE_CONNECT) { @@ -52,7 +47,7 @@ export class EthereumPage implements WidgetPage { await walletPage.connectWallet(connectWalletPage); } expect( - await this.page.waitForSelector('text=Submit'), + await this.page.waitForSelector('data-testid=stakeSubmitBtn'), ).not.toBeNaN(); await this.page.locator('data-testid=accountSectionHeader').click(); expect(