Support for EventListener
In Ruby's client for WebDriver protocol there is a way to place event listeners on various events on WebDriver side (see https://code.google.com/p/selenium/source/browse/rb/lib/selenium/webdriver/support/abstract_event_listener.rb, http://elementalselenium.com/tips/55-wrapper).
Is it possible to do the same in PHP WebDriver version?
Theoretically, this is possible.
In lieu of aspects for cross cutting concerns, I'm not opposed to this.
What I want this for is to be able to set expectations for alert/prompt/confirm dialog before they happen. Ideally knowing if executed WebDriver command resulted in alert/prompt/confirm dialog opening without extra API call would be great as well.
Linking to https://github.com/php-fig/fig-standards/blob/master/proposed/event-manager.md
This is now PSR-14.
Interfaces require PHP 7.2+
- https://github.com/php-fig/event-dispatcher/tree/master/src
reference: https://github.com/seleniumhq/selenium/blob/trunk/rb/lib/selenium/webdriver/support/abstract_event_listener.rb