Firstly, what are Page Objects? Here is a definition from the Selenium team:
Page Object is a Design Pattern which has become popular in test automation for enhancing test maintenance and reducing code duplication. A page object is an object-oriented class that serves as an interface to a page of your AUT. The tests then use the methods of this page object class whenever they need to interact with that page of the UI. The benefit is that if the UI changes for the page, the tests themselves don’t need to change, only the code within the page object needs to change. Subsequently all changes to support that new UI are located in one place.
Using Page objects in test cases has been very useful. It will feel hard and time consuming initially but, once you have all page objects up and running. Its going be a smooth ride . Till now writing test cases for an Angular Apps has been smooth ride. Thanks to some good articles online to get me going.
I have found some very helpful resources, which talks about using Page objects in Protractor for end-to-end testing which, I would like to share with other peps... Enjoy..
- Using Page Objects to Overcome Protractor's Shortcomings
- Using Protractor: Writing end-to-end tests has never been so fun.
- Protractor - end to end testing for AngularJS