This is a sample project for integration tests using Selenium and Cucumber
The tests are written with Gherkin with a .feature
extension. There are some samples available under functional/features
The steps are defined in step_definitions/generic.js
The selenium translation from Gherkin is done in support/helper.js
Note that if you plan on using browserstack or a similar service you don't need chromedriver nor Java as this is managed by those services.
You will however need the jq
command line tool. If you're a brew user just run brew install jq
Nodejs is required. Please install one if you don't have one already. The .nvmrc stores which version should be used.
This requires chromedriver to either be on the system path or the local folder.
Make sure the version of chromedriver matches your version of Chrome :)
For other browsers like firefox get the appropriate driver (Firefox's driver is geckodriver which is available here).
You need to have a local installation of Java since the local Selenium server depends on it to be able to execute.
Make sure you have yarn installed on the node version you're running. You can install it by running npm install -g yarn
Then install the dependencies by exevuting
yarn
java -jar selenium-server-standalone-3.11.0.jar
or
yarn start_selenium
to start the selenium server and yarn stop_selenium
to stop it.
yarn staging
will run the tests against the staging environment.
This example will run on latest Edge browser on a windows 10 machine:
yarn browserstack_staging_win10_edge
To get a full list of options for browserstack consult the capabilities page here