-
Notifications
You must be signed in to change notification settings - Fork 59
Description
For some parts of navigation we currently have a machanism whereby we suppress an event when it's caused by the context.navigate
command and then later re-emit it explictly. That's used to ensure the command has returned before the event is emitted, so clients always have the relevant navigation ids. But the mechanism is unsatisfactory; it would be better to just queue a (micro)task to emit the event in all cases; generally one won't be able to tell the difference, but in the case we invoke the navigation it would give the correct ordering.
We are making use of queue a microtask in the "wait" mechanism, but that is wrong in detail; it depends on an event loop. But the WebDriver spec conceptually doesn't run in a specific js context; it's running in the parent/UI process. So it's unclear to me if we can assume apriori that there is an agent to execute the event loop (at least without handwaving one into existence).