Automated browser tests, in my case, are often part of continuous integration (CI). Failure = no deploy. This naturally creates some expectations towards acceptance/end to end testing framework. I haven’t found the tool which would meet all requirements although CodeceptJS is close. Nevertheless, no matter whether you use Protractor, Nightwatch.js, WebdriverIO, CodeceptJS or anything else based on Selenium you need to set it up and make it talk to the browser.
Selenium and drivers versions are important as not all drivers can run on any version of Selenium and not all browser versions are compatible with the specific driver.
All following commands should be executed from the root of your project.
Get the Selenium Standalone Server
curl -O http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.3.1.jar
Version 3.x of Selenium doesn’t include a driver for Firefox anymore. To run your tests in Firefox 48+ you need GeckoDriver. Check the CHANGELOG for more info.
This particular version requires Java to run:
java -jar selenium-server-standalone-3.3.1.jar
Get the GeckoDriver
curl -O https://github.com/mozilla/geckodriver/releases/download/v0.10.0/geckodriver-v0.10.0-linux64.tar.gz tar -xvf geckodriver-v0.10.0-linux64.tar.gz
You can find other GecoDriver releases on GitHub and download appropriate for your system.
Get the ChromeDriver
curl -O http://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip unzip chromedriver_linux64.zip
curl -O http://chromedriver.storage.googleapis.com/2.29/chromedriver_mac64.zip unzip chromedriver_mac64.zip
You can find other ChromeDriver releases on Chromium website and download appropriate for your system.
|Selenium Standalone Server||Firefox||GeckoDriver||Chrome||ChromeDriver|
Alternative - it’s a Nightmare
Nightmare is a very interesting alternative to Selenium-based testing frameworks. In contrast to those I’ve mentioned at the beginning, I don’t have much experience with it. Based on my tests it was almost 3 times faster on average than WebdriverIO. Under the hood Nightmare uses Electron.
To start using Nightmare all you need to do is install it and start writing tests. No config files required.
npm i -D nightmare
Check it out. Nightmare is definitely worth giving a try!