I am coming from the world of Python and I am a bit confused on how I can add sleeps into my test (only been at JS for a week). I understand that sleeps are not best practice, though I would just like to learn how it can be done. Currently I have a test which launches the browser then immediately fails because the load times on the page. Just for debugging purposes, I would like to pause the test for a couple seconds. This is currently what I have that does not work. Thank you for your responses.
var assert = require('assert');
describe('basic login', function() {
it('verify user is able to login', function () {
browser.url('http://localhost:3000');
var elem = browser.element('div.accounts-dropdown > div.dropdown-toggle > span');
//elem.waitForVisible(2000); //not working
//elem.waitForExist(3000); //not working
return browser.waitUntil (function async() {
elem.click();
browser.setValue('//input', 'sy7nktvw@localhost');
browser.setValue('//div[2]/input', 'kU3SPn75');
browser.click("//button[@type='submit']");
assert('//li/div/button');
}, 50000, 'something_test');
//browser.click('div.accounts-dropdown > div.dropdown-toggle > span');
});
});