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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -