Closed aik099 closed 9 months ago
This driver, however, exposes arguments[0] instead.
This driver avoids the extra step and simply passes valid JS code directly for execution (the invalid syntax warnings was one of the motivations to remove it).
I think, that this also is a BC break,
It can't be so since this is an entirely new package.
because developers now can't switch to this driver without replacing {{ELEMENT}} across their test suite first.
Why is this in any test suite? This is an internal detail of the driver. In Selenium2Driver, executeJsOnElement
is private and none of its usages allow modifying the code from a public method (as far as I can see). DriverInterface
does not expose a way to execute javascript for an element.
In fact, when we remove syn, most of these usages will also be gone.
But maybe I'm missing something - let me know if you have a specific use case in mind.
You're absolutely correct. The \Mink\WebdriverClassDriver\WebdriverClassicDriver::executeJsOnElement
is an internal driver method, that isn't forced to obey {{ELEMENT}}
replacement logic.
I must be looking at too much code today, that I haven't noticed that. I honestly thought it was a public method.
My apologies once again.
No worries!
The https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php uses
{{ELEMENT}}
to mask the internal element representation of an element in the driver (my understanding). Later it replaces it witharguments[0]
when preparing JS code for a WebDriver.This driver, however, exposes
arguments[0]
instead.I think, that this also is a BC break, because developers now can't switch to this driver without replacing
{{ELEMENT}}
across their test suite first.Please use the
{{ELEMENT}}
as in the current Mink's Selenium2 driver (or at least in the public API of the driver).