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

Welcome Protractor!


Protractor is a wrapper for our test runner that will manage of all the WebDriver details. Actions such as starting, stopping, and configuring the desired capabilities will be taken care of by Protractor. It offers us a more simple and direct way of using WebDriver, one where we need less boilerplate code. On top of that, Protractor wraps the API of WebDriver to make it slightly easier to use.

In the beginning, Protractor was designed to be used to test AngularJS applications using the Jasmine test runner. Currently, we can use Mocha and test applications written with other frameworks.

Let's change our project to use Protractor. We can now remove the selenium-webdriver module from our package.json file. Do the same thing with its respective folder under node_modules/. Remove chromedriver and the Selenium Server JAR files. Also remove test/index.js. Now we can install Protractor:

$ me@~/mycafe> npm install --save-dev protractor

The protractor module includes all the necessary...