When testing navigation, it would be great to actually load and navigate through states within a browser. Luckily, we can do just that using Protractor. This is quite compelling, because, typically, to test interactive route changes we would expect a manual process whereby a user would have to load the page in a browser and interact with elements, for example clicking a button to trigger a route/state change. We can configure Protractor to follow a defined set of instructions and mimic user actions thereby saving a lot of our time and effort plus enabling a greater spectrum of application testing. In this recipe, we will test navigation through an AngularJS application based on element interaction using Protractor.
AngularJS Testing Cookbook
By :
AngularJS Testing Cookbook
By:
Overview of this book
<p>AngularJS stepped up to offer a comprehensive solution to frontend development with minimal dependencies and a clear set of objectives.</p>
<p>This book follows the AngularJS philosophy and offers guidance on how to approach testing components that make up the AngularJS framework. At the start of the book, you will explore how to configure your system to run unit and end-to-end tests. Following this, you'll become familiar with fundamental principles on testing AngularJS with Jasmine. Then, you'll understand how spies can enable you to test your code with greater coverage and simplicity throughout your application. The final result is an AngularJS application that is tested with integrity, helping facilitate a cleaner and more reliable codebase.</p>
Table of Contents (16 chapters)
AngularJS Testing Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Setup and Configuration
Getting Started with Testing and AngularJS
How to Test Navigation and Routing
Testing Controllers
Testing User Interaction and Directives
Using Spies to Test Events
Testing Filters
Service and Factory Testing with Mocks and Spies
A Brief Look at Testing Animations
Index
Customer Reviews