Understanding AngularJS End-to-End Testing

I do like using end-to-end testing for web applications; however, in my opinion it is used much too often as the major (if not the only testing). End-to-end testing is great for verifying the system in a general way, but for AngularJS applications you should be using unit testing for the majority of your testing needs.

That having been said, you should also consider implementing some end-to-end testing that can catch regression issues and generally test the overall functionality of your system. End-to-end testing can also expose some system limitation problems such as network or database bandwidth.

The AngularJS folks have created a tool called Protractor that enables you to implement end-to-end testing of your AngularJS applications. Protractor is a Node.js program that will run end-to-end tests written in JavaScript. It uses WebDriver to control the browsers and simulate user actions. The language syntax for Protractor is based on Jasmine, so if you are familiar with Jasmine you should be able to come up to speed quickly.

The idea of end-to-end testing with Protractor is that you can set up certain things in the test environment using Jasmine code and then use WebDriver to provide input to the application through the web browser and then validate the results.

End-to-end testing will vary greatly based on environmental, design, technology, and other variables, so I’m not going to go into it in this appendix. However, I’d suggest going to the following links when you do decide to try implementing end-to-end programming in your AngularJS applications:

https://docs.angularjs.org/guide/e2e-testing

https://github.com/angular/protractor/blob/master/docs/getting-started.md

https://code.google.com/p/selenium/wiki/GettingStarted

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset