-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ScalaWebTest compatible with all implementations of Selenium WebDriver #74
Comments
This is a challenging task because:
Because of this, a few intermediate steps are needed.
|
…Driver #74 - this is work in progress - it's currently coupled to chrome - implementations for response code/headers where removed
I think the final solution should provide three different kinds of Browsers
All three should implement a common interface, but similar to JDBC drivers, some methods might not be implemented, pointing to alternatives which implement said method. HtmlUnitExtended: This webdriver is headless. It uses HtmlUnit and doesn't hide that fact.
Selenium: This might be Chrome, Firefox,... controlled via SeleniumWebDriver API
Selenium Proxied: Again Chrome, Firefox... controlled via SeleniumWebDriver API and using a proxy, which is under our control. This allows ScalaWebTest to read the response code and response headers. This information is not exposed by the Selenium WebDriver API and never will (see SeleniumHQ/selenium-google-code-issue-archive#141 (comment)).
|
…Driver #74 - try to run Chrome on TravisCI
…Driver #74 - try to run Chrome on TravisCI
Following the reasoning from ashley.leyba in SeleniumHQ/selenium-google-code-issue-archive#141 (comment)
We should probably not add Selenium Proxied to ScalaWebTest. I can currently not think of any reasonable use case, where one would require to use Chrome/Firefox/... to test a response code or response header. For those tests, HtmlUnitExtended should be enough. Therefore I would concentrate our efforts on HtmlUnitExtended and Selenium. The ProxiedSelenium variant might follow as a module, but I doubt we will ever need it. |
…Driver #74 - try to run Chrome on TravisCI
We should try to use or integrate with https://github.com/bonigarcia/webdrivermanager |
…Driver #74 - this is work in progress - fetch value for webdriver.chrome.driver from environment and system properties - using configMap from ScalaTest was discarded, because configMap is only initialized when using org.scalatest.tools.Runner to run the test - additionally using configMap would require additional indirection, because we have to delay the initialization of the webdriver until we receive the configMap - therefore we decided to use System.getProperty and System.getenv and provide the Configurable abstraction to access the information
…Driver #74 - this is work in progress - change BaseConfiguration is now abstract and requires a browser specific implementation - Selenium browsers report configurations, which they cannot apply as error, and configurations which are superfluous as warnings - added slf4-simple as dependency for scalawebtest-integration - switched back to HtmlUnit as default browser for the integration tests - reactivated the ResponseAccessors, they do now require WebClientExposingDriver - AemTweaks no longer overrides config, but instead provides additional config via implicit conversion
…Driver #74 - correctly handle JSON responses in Chrome (stripping the HTML wrapper) - added basic tests, to verify functionality across all browsers - moved comments from HtmlUnitConfiguration to BaseConfiguration - with this commit the change should be good enough to be merged back to develop
…Driver #74 - removed explicit use of HtmlUnitWebDriver in some tests (this was introduced as a temporary solution for this PR) - changed initialization of Logger to always use getClass.getName (benefit: we know which test produced this log entry, downside: we do no longer see, which trait contained the code that produced this log entry) - with this commit the change should be good enough to be merged back to develop
…Driver #74 - ChromeDriverServiceRunner can either forward to an existing service runner, or start it's own
…Driver #74 - environment variables in Linux may not contain 'dot', therefore changing webdriver.chrome.driver.service.url to WEBDRIVER_CHROME_DRIVER_SERVICE_URL
…Driver #74 - change WEBDRIVER_CHROME_DRIVER_SERVICE_URL to a valid URL
…Driver #74 - try RemoteWebDriver with empty ChromeOptions
…Driver #74 - Configurable tries property names in upper-case, with dots and hyphens replaced by underscore, when searching an according environment variable, because environment variables under linux may not contain dot or hyphen and are typically in uppercase - Try to start chrome driver service on travis from Scala instead of using the one started in the before_script
…Driver #74 - cleanup travis.yml after finding a working combination of configurations and code
…Driver #74 - switch to BeforeAndAfterAllConfigMap - Configurable now also reads parameters from the ConfigMap - ChromeDriverService initialization is now delayed until the first test needs the according driver - SeleniumChrome arguments are now configurable
…Driver #74 - rename and re-enable WebDriverConfigFixtures as WebClientExposingDriverConfigFixtures - add type annotation in WebClientExposingHtmlUnit and remove the implicit keyword for the webdriver (only the one in IntegrationSpec should be implicit)
…Driver #74 - cleanup commented code - remove superfluous empty parenthesis - implement prettyPrint
ScalaWebTest is now compatible with any Selenium WebDriver. It still uses HtmlUnit as it's default. Also some features, like verifying the responseCode or disabling JavaScript, are only available with HtmlUnit (because the Selenium WebDriver API does not allow to control or access this information). At the moment we provide an implementation to use Chrome. Additional implementations are planned. At least Firefox, probably Safari as well. Our plan is to support all browsers, which we can test with Travis. We do not want to add implementations, which we cannot test as part of our CI build. As ScalaWebTest now works against the Selenium WebDriver API, users are free to plug any Selenium WebDriver, when using ScalaWebTest. |
- merge host and loginPath/basePath into config.useBaseUri/loginConfig.useLoginUri, this makes configuration consistent (always in config object) and allows for cleaner configuration via command line arguments - config.baseUri can be overwritten with the system.property(scalawebtest.base.uri), the environment variable (scalawebtest.base.uri or SCALAWEBTEST_BASE_URI), or the run argument (scalawebtest.base.uri) - loginConfig.loginUri can be overwritten with the system.property(scalawebtest.login.uri), the environment variable (scalawebtest.login.uri or SCALAWEBTEST_LOGIN_URI), or the run argument (scalawebtest.login.uri) - the extension points (or methods) login, beforeLogin and afterLogin now receive the configMap as well. This allows to read run arguments and make use of the Configurable trait in those methods - reactivate the BasicAuthLogin trait, which got broken during the implementation for #74
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver - "--no-remote" should disable dbus communication, therefore not start the dbus-daemon and prevent warnings from the dbus-deamon because no DISPLAY is defined
Firefox implementation was tried with https://github.com/unic/ScalaWebTest/blob/feature/add_firefox The implementation itself works well, but the build on TravisCI is very unstable with Firefox added.
And Firefox sometimes fails with
|
As Firefox isn't stable yet on Travis CI, we will not add it to 3.0.0. For now, everyone interested may just grab the implementation from https://github.com/unic/ScalaWebTest/tree/feature/add_firefox As far as we can tell now, the problem is not in our implementation, but rather in our configuration of the build agent on Travis. Adding Firefox is from now on tracked in #85 |
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver - "--no-remote" should disable dbus communication, therefore not start the dbus-daemon and prevent warnings from the dbus-deamon because no DISPLAY is defined
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
…Driver #74 - add support for Firefox via Mozilla Gecko Driver
If we do not depend on HtmlUnits HTML parsing, we can use other Drivers as well and even extract the gauge logic completely.
Ideally, we can compile this for Scala.js and use it in other tools like TestCafé.This will not be possible, as we have to parse HTML (see next comment). Most probably a rewrite for JS is the better option, if we want to use Gauges in TestCafé.The text was updated successfully, but these errors were encountered: