-
Notifications
You must be signed in to change notification settings - Fork 17
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
Auto-switch windows when a single window is closed and replaced #733
Comments
There's been some issues getting the next major out, see #533 for details. The betas have been tested with WDIO v9 in It sounds like Chromedriver is trying to connect to the splash screen. I'm not sure why this would change with WDIO v9... |
v7 of the service has been released now, this only works with WDIO v9. Can you try it again with the latest builds? Presumably the tests work when the splash screen is disabled? |
How does chromedriver know whether somthing is a splash screen or de main window? |
Do you have a repo to look at? It's not easy to debug without seeing what the app is actually doing. |
I have now :) See RedX2501/electron-react-test@c30f1f3 I have a separate project in which the tests are. I will package the electron app and then use I write acceptance tests for the binaries we receive to make sure they comply with our specs. |
I have tried with the released v7 and it's still the same problem. If I change the code to find all the handles and then switch to the only handle available it actually works. This behaviour I know from the v6 version, although I think it's counter intuitive. I need to enumerate all handles because calling The error is
|
So, does it work if you disable the splash screen? Also, you mention the approach of changing the code to switch handles was known from the previous version. Does this mean the error also occurs in WDIO v8 if you do not do this step? I'm just trying to properly define this issue as it is clear the splash screen use case should be supported, but it's not obvious how this relates to the new v9 release (if it does at all). I'm going to refer only to WDIO versions going forward, you should be using v7.x of the service with v9.x of WDIO, and v6.x of the service with v8.x of WDIO. |
Hi, I have tested it some more. If I have only one window it does work. So basically it boils down to my expectation that I'm fine with closing this ticket as wrong expectation. Should I open another one about the getTitle (and other functions) failing when the first window closes? In this repo or another? Is this behaviour documented somewhere? |
So it definitely sounds like the display time of the splash is too short for WDIO to run tests on the splash, which results in the I would have a separate Then all other spec files could either wait until the splash is replaced with the main window, or simply run the app with a splash display time of 0 - so the splash is replaced with the main window immediately - before running their tests. You could search (or ask) in the main WDIO forum about how best to test projects with splash screens, I'm sure there will have been others with the same issue. There is also the WDIO Discord where you can ask questions around testing with WDIO. We could consider some kind of splash screen helper in the service but I'm not sure it would save much time or code, the solution here seems to be an improved structure for your tests to test the splash separately from the main window. |
I think i didn't express myself correctly. I don't want to test the splashscreen, what's undocumented/weird ist that even if i wait long enough for the main window to appear browser.getTitle fails. Only after switchToWindow it works again. I would have expected to not need to explicitly call switchToWindow when getHandles returns only one entry. |
Ok, I see. That sounds like something which could have a solution attached. So you're saying that you need to explicitly call switchToWindow after the splash is closed, in order to switch to the main window from the splash. @christian-bromann Do you think there's a feature request here? It would make sense if WDIO could auto-switch windows in this splash screen case. |
This affects many other functions too even |
Possibly related: webdriverio/webdriverio#13436 |
I would assume that the WebDriver protocol automatically switches the window handle if a window closes. Let me verify that. |
@christian-bromann Any update on that? In the service we could periodically check the output of |
@goosewobbler I haven't verified this assumption yet. However we added more logic to keep track on the current context to ensure that WebDriver Classic as well as Bidi commands are executed correctly in the right frame. I think this scenario should be handled in WebdriverIO core, e.g. automatically switch to the current context if one got closed. |
I thought it sounded like more of a core thing. Closing as not planned, the windowing E2Es are still valuable so #771 can stay open. |
I have a project that runs fine with Webdriver v8.40.3 and wdie-electron-service 6.
I'm trying to migrate to v9.
I have tried using 7.0.0-beta.10 but that did not solve the problem.
I have created a fresh wdio test project to make sure it's not a cnofiguration error.
I'm using electron 29.1.4.
Error:
The project uses a splash screen that closes once the main window successfully connects to the backend.
The text was updated successfully, but these errors were encountered: