Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky native send and transaction decoding test #29362

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/e2e/page-objects/pages/test-dapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,16 @@ class TestDapp {
}

async clickSimpleSendButton() {
await this.driver.waitForSelector(this.simpleSendButton, {
state: 'enabled',
});
await this.driver.clickElement(this.simpleSendButton);
}

async clickERC721MintButton() {
await this.driver.waitForSelector(this.erc721MintButton, {
state: 'enabled',
});
await this.driver.clickElement(this.erc721MintButton);
}

Expand Down
8 changes: 7 additions & 1 deletion test/e2e/webdriver/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class Driver {
// bucket that can include the state attribute to wait for elements that
// match the selector to be removed from the DOM.
let element;
if (!['visible', 'detached'].includes(state)) {
if (!['visible', 'detached', 'enabled'].includes(state)) {
throw new Error(`Provided state selector ${state} is not supported`);
}
if (state === 'visible') {
Expand All @@ -368,7 +368,13 @@ class Driver {
until.stalenessOf(await this.findElement(rawLocator)),
timeout,
);
} else if (state === 'enabled') {
element = await this.driver.wait(
until.elementIsEnabled(await this.findElement(rawLocator)),
timeout,
);
}

return wrapElementWithAPI(element, this);
}

Expand Down
Loading