Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seaona committed May 28, 2024
1 parent e9a3802 commit ca8a454
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/e2e/webdriver/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,17 @@ class Driver {
return elements.map((element) => wrapElementWithAPI(element, this));
}

async clickElement(rawLocator, retries = 2) {
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) {
if (
error.name === 'StaleElementReferenceError' &&
attempt < retries - 1
) {
await this.driver.delay(1000);
} else {
throw error;
Expand Down

0 comments on commit ca8a454

Please sign in to comment.