I am writing e2e test cases using protractor for my angular application. I have a service in my application called UserService which holds user information. I have an API getUser in this service to get the user data. I need to access UserService in my protractor test cases.
I looked at some of the articles and found that I could use browser.executeAsyncScript to access my services. But If I use this method , I am gettiing the injection issue.
In my application, the module is defined as:
var angApp = angular.module('myApp', ['ngCookies','ngResource']);
and all directives, services and controllers are created using angApp module.
Now I need to access my UserService so that I can call getUser API in my protractor testcases.
Could someone help me in accessing userService in my protractor testcases?
Aucun commentaire:
Enregistrer un commentaire