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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -