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

Summary


In this chapter, you learned how to run our test suite in different browsers. For this, we used two different tools: WebDriver and Protractor.

Although we can directly use WebDriver to do so, the setup and code can be a bit more cumbersome.

Protractor offers us a more streamlined approach than using WebDriver out-of-the-box. The setup and configuration are much easier, and the API that we are offered is more powerful.

This is especially important if your UI is written with AngularJS, since Protractor offers a special API to access and control elements in the context of AngularJS. You can find elements by bindings, model, or repeater. You can also set up test doubles for AngularJS modules, such as controller or service. Finally, Protractor will take care of waiting for AngularJS to finish loading and rendering.

This does not mean that we cannot use Protractor with a non-AngularJS application. As you have seen, we can test a ReactJS application perfectly well using Protractor. You just...