angularjs - How to run a javascript function before starting any test case in Protactor? -
actually, writing test cases 1 angular app first page taking time load , having popup box instruction. need store value in localstorage of browser making popup box invisible. how can run javascript function before running test case?
by default, protractor syncing angular, makes wait $http or $timeout can check if that's case on particular page this: canonical way debug protractor-to-angular sync issues
or can inject behaviour mocked module
protractor.config.js
onprepare: function() { var dothefuncystuff= function() { angular .module('dothefuncystuff', []) .run([function(){ //do here popup isn't displayed window.localstorage.setitem('my-var', 'my-val'); }]); }; browser.addmockmodule('dothefuncystuff', dothefuncystuff); }
Comments
Post a Comment