Is it possible to access angular within your protractor tests like you do in unit testing?
Use case is that I have a service that transforms text and I want to access that service to transform some data within the actual test script. I know there is the addMockModule
method in protractor but I cannot figure out how to use it for this purpose.
Would appreciate any help!
There is a function called evaluate(). Find an element in the dom and then run the expression.
For example. If you want to count the number of todos in the http://angularjs.org/ website (under Add Some Control), do this:
Open the element explorer in protractor
It should give you a 2
You can also use executeAsyncScript
See an example: https://github.com/andresdominguez/protractor-meetup/blob/master/test/e2e/api-helper.js