Mocking an angular service in Protractor
问题 I'm trying to use Protractor's addMockModule to insert mock data in my end-2-end test. My test is supposed to go to a web site, find a button by css-class and click it. The button click calls the function dostuff() in MyService, which fetches data from the backend. My code so far: describe('should display validation error', function () { it('should work', function () { browser.get('http://my.url'); browser.addMockModule('MyService', function () { // Fake Service Implementation returning a