How to control the flow of methods that don't return promise in protractor test -


i've got spec i'm grabbing screenshot requires dynamic path created. makedir not return promise, fires @ same time (after) savescreenshot. what's best way ensure makedir called first?

getpath().then(function(path) {     makedir(baseurl + '/' + path);      savescreenshot(baseurl + '/' + path + '/' + filename); }) 

you should able chain then() , second operation in there.

getpath().then(function(path) {     makedir(baseurl + '/' + path);      var screenshotpath = baseurl + '/' + path + '/' + filename;     return screenshotpath; }).then(function(screenshotpath) {     savescreenshot(screenshotpath); }); 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -