A look at various frameworks to help with acceptance testing. See webpro/Automated-SPA-Testing for unit and functional testing.
Criteria to consider
- Ability to use Feature files with the framework.
- Some form of Given When Then syntax in Step Definitions.
- Can easily be used in a Continuous integration environment (exit codes should be handled correctly)
- Decent reporting out of the box in formats that Jenkins/TeamCity would support (TAP, JUnit XML).
- SauceLabs support is a plus.
- Reporting wasn't amazing. Looks like it's still a work in progress. No colouring in the output (issue: 104).
- Slow progress on a number of a issues.
- Due to the async nature, neglecting to call the callback passed to each method in a step def doesn't actually fail. This means failing steps can appear to pass when actually they weren't run at all.
- Example: /cucumber-js
- Github: https://github.com/cucumber/cucumber-js
- Twitter: https://twitter.com/cucumber_js
The repo RageMaion/node-bdd-example contains a working example of cucumber.js along with a number of useful techniques:
- Uses Grunt as a task runner: Gruntfile.js
- Cucumber feature files: New_Office_Search.feature
- Concept of a "World": World.js which hooks into the Cucumber BeforeScenario event to nullify the browser reference
- Promises compatible "browser factory" for actually starting up the browser: browserFactory.js
- "Friendly" page names in feature files which map actual page interfaces in code via: getNamedPageCmd.js
- Generalised step definitions: generalizedDefinitions.js
- Page specific interface: HomePage.js
- Configuration for cloud based testing or local testing: testConfig.js