Long Polling http request;
Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds.
angular.module('someName').factory('eventPoll', eventPoll);
eventPoll.$inject = ['$rootScope', '$log', '$interval', 'eventPollService'];
Due to this factory 'eventPoll', my protractor tests are getting failed.
I am using it in my test to avert this:-
browser.addMockModule('notificatonOverride', function() { angular.module('notificatonOverride').service('eventPoll', function() { function eventPoll($rootScope, $log, $interval, eventPollService) { }); });
how to resolve this??
Please read https://help.github.com/articles/github-flavored-markdown/ to learn how to use markdown to format your issues better, this makes it much easier to read and respond.
This is a limitation in the way that Protractor waits for pages to be stable. What you are doing looks like a good workaround, are you having problems with it?
Thanks for the response. The workaround is not working for me.
In my scenario I have a big Module and inside that have a factory(Long polling one). I don't want to wait for that factory. Essentially just want to mock that particular factory.
angular.module('vManage').factory('eventPoll', eventPoll);
eventPoll.$inject = ['$rootScope', '$log', '$interval', 'eventPollService'];
function eventPoll($rootScope, $log, $interval, eventPollService) { ...}
So can you please explain how can I do that?
OK, it sounds like this is more of a question than an issue or feature request, so I'm closing the issue per our contribution guidelines.
You want to do something like:
browser.addMockModule('notificatonOverride', function() {
angular.module('notificatonOverride').factory('eventPoll', function() {
// intentionally left blank, noop
});
});
@juliemr i am facing the same issue . Even after using the above addMockModule solution . We are unable to mock the the event Poll
How do you know that the service is not mocked? Have you verified that the mock is set up properly and that there is not another polling event on the page?
We have followed the test code you suggested and this is the only long poll event on the page .
It's very hard to help without specifically knowing what is not working or having a reproducible example - could you make a minimal example that reproduces the issue?