Skip to content

Commit

Permalink
Fix for wait.byIdAndVisible command (#2179)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Sep 13, 2024
1 parent 465f1de commit 3f73e11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/core/engine/command/wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ export class Wait {
* @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
* @throws {Error} Throws an error if the element is not found within the specified time.
*/
async byIdAndVisible(id, maxTime) {
async byIdAndVisible(id, maxTime = 6000) {
const driver = this.browser.getDriver();
await this.byId(id, maxTime);
try {
driver.findElement;
await driver.wait(
webdriver.until.elementIsVisible(webdriver.By.id(id)),
webdriver.until.elementIsVisible(
driver.findElement(webdriver.By.id(id))
),
maxTime
);
} catch (error) {
Expand Down

0 comments on commit 3f73e11

Please sign in to comment.