Update: 26/04/14 – added example github project showing an example project with config setup and simple test.
Example project on github: https://github.com/onekilo79/protractor-astrolabe-example
Page Object Pattern
When writing browser based tests with selenium the test can become brittle if they are too attached to the xpath of the css selector when the page look and feel changes. To limit your exposure to changes in the styling of the page you can use the Page Object Pattern.
Library that does Page Object Pattern in Groovy
In Groovy we have the excellent Geb by Luke Daily.
The reason to install protractor globally is that if you use the inline protractor provided with grunt-protractor-runner you have a 10 second penalty of waiting for the server to spawn a java process and then attach itself to it.
With the server already started and waiting for calls it is a lot faster turnaround for your tests to run.
Install protractor globally
If you have installed protractor globally to do your end to end testing via:
You may have to do this as sudo if you
npm -g install protractor
Download the chromedriver by updating webdriver-manager
Angularjs jasmine waiting for event timeout with the angularjs $timeout
Better way to wait for the timeout of events. Angularjs mocks has special methods to flush() so you do not have to wait for an event to occur.
Update(22/04) Better to use this http://jsfiddle.net/onekilo79/KS6MY/
Jasmine 1.3 and waiting for event test using a directive
What I have learned from testing using Jasmine 1.3 and waiting for event test using a directive.
Testing an Angularjs controller with a jasmine spy mocked service and http promise
Learned the hard way on how to mock a service that we also use jasmine to spy upon. The service returns the http promise which the controller deals with by adding things on the scope.