A variety of bridge steps between cucumberjs and webdriverjs.
The approach taken here I'm calling 'Selenium Mappings Model'. Read about it!
For local testing, you will need Firefox to test Firefox, Chrome and the Chrome Driver to test Chrome, and the Selenium Standalone Server to test Safari, IE, or [Opera][op]. (The qcumberbatch cucumber grunt task works well with a standalone grunt task.)
Run this task with the
grunt cucumber command.
Task targets, files and options may be specified according to the Grunt Configuring tasks guide.
Specify the list of OS and Browser versions to test. The keys of the object are strings specifying
"<os> [version] [resolution]". The values are an array of strings, each entry being one of "browser [version]".
Each of the properties' values are constrained by the Browserstack and Selenium Webdriver configuration and documentation. To run local tests, specify
local for the OS, and no version or resolution. To run tests against browserstack, specify
Windows for the OS, a Browserstack version for the os version (
Mavericks, etc). Locally, browsers can be anything loaded from
selenium-webdriver/Capabilities. On Browserstack, specify an appropriate name and version. To test on a mobile device, set
os as one of
portrait; and put the entire device name in the browser array.
A complete example:
matrix:"Windows 8.1 1280x1024":'IE 11.0''Chrome 36.0'"Windows XP 1024x768":'Firefox 31.0'"OS X Mavericks 1920x1080":'Safari 7.0''Firefox 31.0''Chrome 36.0'"ios portrait":'iPad 4th Gen'"android landscape":'Google Nexus 7'
If true, stop the grunt task after the first error in a selenium test. Otherwise, will run tests on the entire device matrix, and only fail after all tests have completed.
These have the same meanings as their cucumberjs CLI counterparts.