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

fix: flaky test onboarding @no-mmi doesn't make any network requests to infura before onboarding is completed/test-failure-screenshot.png and onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png #24813

Merged
merged 3 commits into from
May 28, 2024
Merged
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
20 changes: 17 additions & 3 deletions test/e2e/webdriver/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,23 @@ class Driver {
return elements.map((element) => wrapElementWithAPI(element, this));
}

async clickElement(rawLocator) {
const element = await this.findClickableElement(rawLocator);
await element.click();
async clickElement(rawLocator, retries = 3) {
for (let attempt = 0; attempt < retries; attempt++) {
try {
const element = await this.findClickableElement(rawLocator);
await element.click();
return;
} catch (error) {
if (
error.name === 'StaleElementReferenceError' &&
attempt < retries - 1
) {
await this.driver.delay(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this what was intended?

await this.delay(1000);

I'm not seeing a delay function on the internal webdriver instance. I'm seeing a this.driver.delay is not a function error on various e2e jobs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops that is a great catch! indeed it should be this.delay()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the fix
#24838

thank you v much Mark 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the bright side, this means that this race-condition was happening quite often 😅

} else {
throw error;
}
}
}
}

/**
Expand Down