1

I would like to use Protractor to perform automatic screenshots across all our e2e tests.

The purpose for that is to be able to review those screenshots occasionally in case there're some visual slips we introduced. My idea to accomplish this automatically is to take a screenshot after angular ui router performs state transition.

The transition is a good indication we'll be looking at a different view. My question thus is, is it possible for Protractor to hook up to state transition?

Marcin Rybacki
  • 974
  • 1
  • 9
  • 19
  • 1
    This should be a good start: [Check angular ui route state using protractor](https://stackoverflow.com/questions/34501054/check-angular-ui-route-state-using-protractor). – alecxe May 30 '17 at 13:44

1 Answers1

0

For AngularJS (1) you can use mockModules, I don't exactly know if you can hook onto the router then. With Angular (2) you can't use mockModules.

Possible alternatives are:

  • listen to url changes
  • Create a customer methods that also adds taking a screenshot after url change when you click on an element that results in a route change.

Hope it helps

wswebcreation
  • 2,365
  • 2
  • 10
  • 18