I have a a test script in Node js which should ideally run sequentially. There are some functions which do not return anything but just perform certain operations like navigating to a menu or doing a key presses. Also, in my test I am making GET and POST request. Because of this sometimes if I have 10 steps and making a request is step 5, sometimes step 6 and 7 get executed before 5. I understand I should be using promises or callback. But I am unsure on how to use them in functions which do not return anything. Here is what my code looks like
browser.url(browser.options.baseUrl);
browser.waitForVisible(myLibraryPO.pageTitle, 15000, false);
let token = getTokenFromLocalStorage()
settingsPO.resetProgram(token); // POST call
browser.refresh();
guidePO.launchA();
guidePO.launchB();
guidePO.filter('NEWS');
guidePO.switchToC();
verifySettings(token,'NEWS'); // GET call