I am running angular tests using protractor and trying to set cookies but doesn't seem to work. How can I add waiting until cookie is set?
public async visit() {
await navigateTo();
return this.whenReady();
}
export async function navigateTo() {
browser.get('http://' + 'localhost' + ':4200');
browser.manage().addCookie({ name: 'auth', value: 'true', path: '/', domain: 'localhost' });
await browser.manage().getCookie('auth');
}
it always return null and cookie is not set.