Question

I'm looking to adopt Agile Development for a project based on web2py on the backend and Ember on the front end. For that I would like to use Behavior Driven Development (BDD) tools like Cucumber and Capybara for Rails. An implicit requirement is that the members of the team writing the user stories should be able to write and run BDD tests without deep knowledge of the code being developed.

I think that Cucumber.js combined with Zombie.js or Selenium would be a good approach but then there are Jasmine and Mocha. Both claim to enable BDD testing for JavaScript but I have the feeling that they are more suited to Unit Testing rather than to testing web applications by simulating how a real user would interact with the application.

Can anyone who has tried BDD with Cucumber.js, Jasmine or Mocha share their point of view as to which one would be the better choice for BDD with javascript?

Also, are there any other alternatives to consider?

Was it helpful?

Solution

For a full BDD testing Stack you could use:

1) cucumber.js + selenium + Soda (or other adapter for node) + node.js

or

2) cucumber.js + zombie.js + node.js

Personally I would go with the second option, since cucumber.js provides you with stub javascript code after parsing your scenarios/features/step definitions written in Gherkin syntax. you can use this code and additionally setup your zombie world and provide all the necessary assertion helper functions for your test suites and you are all setup. The only advantage I see in selenium is his Webdriver capabilities (sauce labs etc.) and the record functionalities, but I think the syntax used in zombie.js to drive the tests is pretty strait forward and maybe you don't need all the functionality selenium provides you.

About mocha and jasmine, if you want Gherkin syntax then none will provide you this feature, but if you like to write all your test in a Rspec syntax style you can go with one of these instead of cucumber.js, it all depends how important the Gherkin style is to you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top