"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:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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!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.