MinkSelenium2Driver
MinkSelenium2Driver copied to clipboard
Allow subclassing of Selenium2Driver class
Currently I have a problem with subclassing the Selenium2 driver (I created a version which adds support for extra SauceLabs features): the method setWebDriver() is typehinted to WebDriver, which is a final class.
I am passing in my own version of a WebDriver, which extends AbstractWebDriver, and to make it work have reimplemented the setWebDriver method in my subclass of Selenium2Driver.
But the fact that the reimplementation removes the typehinting generates a php strict error, which can make the test fail depending on php configuration.
In short: I think that setWebDriver method should use a 'wider' typehinting
PS: Maybe this could be fixed in the webdriver repo... creating an issue there
https://github.com/instaclick/php-webdriver/issues/71
We cannot typehint AbstractWebDriver, as we rely on methods not available in it.
Exact. That's why I proposed this: https://github.com/instaclick/php-webdriver/pull/72
@gggeek what kind of features have you added ?
The WebDriverInterface, which sports the only method I saw used in the Selenium2Driver: session()
What I'm asking is what kind of features you are adding in your subclass.
Sorry, I realized that after answering.
Support for a proxy (it gets injected from selenium2driver into the webdriver)
You can see it here: https://gist.github.com/gggeek/cf534864273e7fa8dfec
I've commended on https://github.com/instaclick/php-webdriver/issues/71.
I think, that for now ability to specify curl options for every curl call made in WebDriver, that later you specify upon Mink driver instantiation would be what you're after.