Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: isPromise() returning false for thenable objects #11045

Closed
cstringer opened this issue Sep 20, 2022 · 4 comments
Closed

[馃悰 Bug]: isPromise() returning false for thenable objects #11045

cstringer opened this issue Sep 20, 2022 · 4 comments

Comments

@cstringer
Copy link
Contributor

cstringer commented Sep 20, 2022

What happened?

84dd610#r84520555

In the above commit, the isPromise() utility function was simplified to look for the return from Object.prototype.toString() to be'[object Promise]', however this fails the function's JSDoc documentation that any object exposing a then() method would be considered a Promise (for example a WebElementPromise returns '[object Object]').

My scripts that rely on WebDriver.wait(<WebElementPromise>) currently fail, but work after reverting the above change.

I propose that the previous functionality is returned to the isPromise() function to allow thenable objects to be treated as Promises.

Note: this may relate to the issue #9348

How can we reproduce the issue?

Pass an object with a `then()` method (for example a `WebElementPromise`) to `isPromise()`, it will return `false`.

Relevant log output

n/a

Operating System

Mac OS

Selenium version

selenium-webdriver@4.4.0

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 105.0.5195.19 (b9c217c128c16f53d12f9a02933fcfdec1bf49af-refs/branch-heads/5195@{#176})

Are you using Selenium Grid?

No response

@github-actions
Copy link

@cstringer, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@cstringer
Copy link
Contributor Author

so sorry for that first PR, was moving a bit too fast this morning 馃う

@harsha509
Copy link
Member

Thank you for the PR @cstringer !

Closing this as resolved as PR #11048 is landed !

@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants