I'm trying to get my script to go to a new page after successfully logging in, however, it attempts to go to the next page before login is complete.
const page = await browser.newPage();
page.goto('https://website/login');
page.once('load', async () => {
console.log('Page loaded!');
// Login script here
});
I can't figure out how to go to a new link after logging in though, my original solution was to just do;
// go to stats
await page.goto('https://www.website/stats');
However, since the page is already defined, this doesn't really wait for anything.
Is it possible to have a callback in the .click() function to go to a new page after?