question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"TypeError: Wait condition must be a promise-like..." persists in v4.0.0-beta.2

See original GitHub issue

🐛 Bug Report

We are still receiving

TypeError: Wait condition must be a promise-like object, function, or a Condition object

despite having upgraded to selenium-webdriver@^4.0.0-beta.2. We are using a custom Jest environment to provide a global driver: WebDriver object. This seems like it’s related to #5560 and #5749, opening a new issue as suggested by @diemol.

To Reproduce

The code that produces the error looks like this:

// login-page.ts
import {By, WebDriver, until} from 'selenium-webdriver'

export class LoginPage {
  constructor(driver: WebDriver) {
    this.driver = driver
  }
  // ...

  login = async () => {
    await this.driver.wait(until.elementLocated(By.xpath('some-xpath')))
    // ...
  }
}
// login-page.test.ts
import {LoginPage} from './login-page'

describe('test suite', () => {
  it('logs in', () => {
    const page = new LoginPage(global.driver)
    await driver.get('some-url')
    await page.login()
    // ...
  }
  // ...
}

Expected behavior

The line runs without a TypeError.

Test script or set of commands reproducing this issue

I can work up a demo repo, if needed.

Environment

OS: macOS 11.2.3 Browser: Chrome Browser version: 89.0.4389.90 (Official Build) (x86_64) Browser Driver version: chromedriver@^88.0.0 Language Bindings version: Node 12.14.0 and selenium-webdriver@4.0.0-beta.2 Selenium Grid version (if applicable): N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
clmaycommented, Nov 5, 2021

@potapovDim hey, thanks for tagging me, I hadn’t seen the continued conversation here. I’m no longer working with selenium-webdriver and don’t have access to the project where this was an issue. It looks like others are still affected, I hope they can provide additional information to diagnose and resolve. Cheers!

0reactions
github-actions[bot]commented, Jun 13, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mocha With Selenium The Error: TypeError: Wait condition ...
Mocha With Selenium The Error: TypeError: Wait condition must be a promise-like object, function, or a Condition object ... I'm new to Mocha...
Read more >
Bountysource
"TypeError: Wait condition must be a promise-like..." persists in v4.0.0-beta.2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found