Does anybody have a working example of how to $rootScope.$broadcast event in Protractor tests?
I know Protractor is not used for this, and that i should use Karma for unit testing. But the situation is that I need to broadcast an event in Protractor test. For this i need to get the $rootScope, i guess. But i do not know how to do it in Protractor and I failed to find an answer in the internet after long hours of searching.
I guess the below regards unit testing. There is no inject in protractor.
var rootScope;
beforeEach(inject(function($injector) {
rootScope = $injector.get('$rootScope');
}));
$rootScope.$broadcast("EVENT_TO_TEST", other, possible, args);
Hope the solution exists.
Aucun commentaire:
Enregistrer un commentaire