Book Image

Learning Single-page Web Application Development

Book Image

Learning Single-page Web Application Development

Overview of this book

Table of Contents (15 chapters)
Learning Single-page Web Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring Protractor (e2e testing)


Protractor is a framework of functional tests for AngularJS applications. It serves as an integrated solution that combines powerful tools and technologies, such as Node.js, Selenium WebDriver, Jasmine, Cucumber, and Mocha.

Tip

You can find more information about Protractor at https://github.com/angular/protractor. Jasmine is also compatible with Protractor because all the resources that are extracted from the browser to perform the tests are promises. Also, the expect() function of Jasmine internally handles these promises and makes it seem transparent validations tests.

However, the MEAN.JS generator does not have Protractor in its default installation. So, let's add the necessary dependencies to begin the test with this powerful framework. Perform the following steps:

  1. Open your terminal in the root project folder and type the following command:

    npm install protractor –save-dev
    
  2. In the grunt-protractor-runner folder, open the node_modules/protractor/bin...