-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: switchFrame()
doesn't always accept promise
#13856
Comments
Initially I've opened a webdriverio-community/wdio-electron-service#818, but after some debugging I can see that it's rather a problem of The webdriverio/packages/webdriverio/src/commands/browser/switchFrame.ts Lines 76 to 84 in 5253860
So, I think it should rather be fixed in this repository. |
Hi there, I think that awaiting the promise is the quickest and easiest solution for now but I do feel like we can/should support this indeed 👍 |
@erwinheitzman, yeah, that's what I do as a workaround. But I would like to note that TypeScript doesn't agree with me that the result of That's probably another bug with types (let me know if I should report it too), the object returned from |
I'd like to note that there's some inconsistency in the docs here: In most of the docs, e.g. the selectors examples |
@goosewobbler with v9 we introduced the .getElement method on the Element object which you can use to make TS stop complaining 🙂 |
@erwinheitzman so you would suggest the following?
My WDIO bandwidth is currently occupied with getting back into webdriverio-community/wdio-electron-service#308, but I'll see if I can fit it in! EDIT: updated to add |
@goosewobbler yes but with the awaited added as well 👍 |
This has changed in v9 and we haven't really fully cleaned up our docs. Elements don't need to be awaited anymore. Anyway, |
Thanks for reporting! We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers! |
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
v9.2.8
Node.js Version
v22.6.0
Mode
Standalone Mode
Which capabilities are you using?
What happened?
The
await browser.switchFrame($('iframe'))
will fail in Electron app test setup withwdio-electron-service
with the following error:What is your expected behavior?
Based on
switchFrame()
WDIO docs and existing test in E2E test suite, the following construct should work with no errors:How to reproduce the bug.
Here is the repo to reproduce the problem: https://github.com/gavvvr/wdio-electron-service-818
Relevant log output
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: