Skip to content

Commit

Permalink
added method customWaitIsPresented
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebyt committed May 9, 2024
1 parent 07497cc commit a996c77
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/e2e-tests/pages/basepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,22 @@ class BasePage {
await this.driver.manage().setTimeouts({ implicit: defaultWaitTimeout });
return false;
}
async customWaitIsPresented(
locator,
timeout = defaultWaitTimeout,
repeatPeriod = defaultRepeatPeriod
) {
this.logger.info(`BasePage::customWaitIsPresented is called.`);
const result = await this.customWaiter(
async () => {
const elemsPresented = await this.findElements(locator);
return elemsPresented === 1;
},
timeout,
repeatPeriod
);
return result;
}
async sleep(milliseconds) {
this.logger.info(`BasePage::sleep is called. Value: ${milliseconds}`);
await this.driver.sleep(milliseconds);
Expand Down

0 comments on commit a996c77

Please sign in to comment.