Book Image

Learning Behavior-driven development with Javascript

Book Image

Learning Behavior-driven development with Javascript

Overview of this book

Table of Contents (17 chapters)
Learning Behavior-driven Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Testing a rich Internet application


Now that we have a basic understanding of the capabilities of WebDriverJS and as we have clarified that we intend to test only our passive view in integration with the browser, we can start by setting up a project in the usual way: create a folder with the lib/ and test/ subfolders, issue the npm init command, and follow the instructions.

For the testing, we will use Mocha. Why not Cucumber.js? Well, it is a good idea to use Cucumber.js to test the core UI logic layer, as we will see later. However, passive view is a very technical layer in nature, and the only stakeholders that could be really interested in it would be the UX designer and the HTML/CSS expert. It is not uncommon that in some agile teams one or even two of these roles are fulfilled by a member of the team and not an external person. So, there is not much sense in adding the extra cost of using Gherkin.

Tip

Since tests that interact with browsers are usually slow, I recommend that you increase...