Skip to content

Commit

Permalink
fix: eth widget locators
Browse files Browse the repository at this point in the history
  • Loading branch information
itaven committed Dec 13, 2023
1 parent a02d663 commit e59bfe7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/widgets/src/ethereum/ethereum.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand Down

0 comments on commit e59bfe7

Please sign in to comment.