Book Image

AngularJS Web application development Cookbook

By : Matthew Frisbie
Book Image

AngularJS Web application development Cookbook

By: Matthew Frisbie

Overview of this book

Packed with easy-to-follow recipes, this practical guide will show you how to unleash the full might of the AngularJS framework. Skip straight to practical solutions and quick, functional answers to your problems without hand-holding or slogging through the basics. Avoid antipatterns and pitfalls, and squeeze the maximum amount out of the most powerful parts of the framework, from creating promise-driven applications to building an extensible event bus. Throughout, take advantage of a clear problem-solving approach that offers code samples and explanations of components you should be using in your production applications.
Table of Contents (17 chapters)
AngularJS Web Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Incorporating E2E tests and Protractor in Grunt


Out of the box, Yeoman does not integrate Protractor into its test suite; doing so requires manual work. The Grunt Protractor setup is extremely similar to that of Karma, as they both use the Jasmine syntax and *.conf.js files.

Note

This recipe demonstrates the process of installing and configuring Protractor, but much of this can be generalized to incorporate any new package into Grunt.

Getting ready

The following is a checklist of things to do in order to ensure that your test suite will run correctly:

  • Ensure that the grunt-karma extension is installed using the npm install grunt-karma --save-dev command

  • Save yourself the trouble of having to list out all the needed Grunt tasks in your Gruntfile by automatically loading them, as follows:

    • Install the load-grunt-tasks module using the npm install load-grunt-tasks --save-dev command

    • Add require('load-grunt-tasks')(grunt); inside the module.exports function in your Gruntfile

How to do it…

Adding Protractor...