I have this:
private isLogged(): boolean {
//check cookie here
let logged: boolean;
browser.manage().getCookies().then((cookies: IWebDriverOptionsCookie[]) => {
if (cookies.length == 0) {
console.log('Is Not Logged');
console.log('My cookies', cookies);
logged = false;
});
console.log('isLogged: ' , logged);
return logged;
}
When I run this, the logged is:
undefined
I go into the Is Not Logged and My cookies inside.
Am I missing sth or just tired and do not see simple mistake ?