Here is my current code snippet:
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;
}
Upon executing this code, the value of "logged" variable is:
undefined
I can see the messages "Is Not Logged" and "My cookies" being displayed.
Could it be that there is a simple mistake that I am overlooking due to tiredness?