drevops / behat-steps

🧪 A collection of Behat step definitions for Drupal
GNU General Public License v3.0
18 stars 13 forks source link

Check for feature support rather than driver class #123

Closed xurizaemon closed 1 year ago

xurizaemon commented 1 year ago

Currently there are some checks which look for a specific driver implementation, but which might better check for support in the driver. Here's an example:

https://github.com/drevops/behat-steps/blob/master/src/WysiwygTrait.php#L37-L43

Aside from the hardcoded classname, that code is likely compatible with other JS-capable drivers listed on https://mink.behat.org/en/latest/guides/drivers.html

If we used a try/catch for UnsupportedDriverActionException in cases like this, we could permit this to function much as it does, but with support for a broader range of drivers.

There are some locations where the implementation does appear to be Selenium2 driver specific (eg KeyboardTrait uses Syn which according to comments there is a shim from Selenium2). In such cases I don't propose changing the behaviour here.

https://github.com/drevops/behat-steps/blob/master/src/KeyboardTrait.php#L43-L46

AlexSkrypnyk commented 1 year ago

implemented