I have a piece of code submitting a form. After that form I need a selector (await page.waitForSelector("selector")) to know if the submition has failed or not.
The code fills all the fields in the form and submits it successfully. The problem here is that when the form is submitted, I'm redirected to another page and the context is then lost, or at least that's my theory.
// fill information
await page.type("#email", email)
await page.type("#password", password)
await page.type("#confirm-password", password)
// submit form
await page.click("#register-submit-button")
// wait for selector
await page.waitForSelector(".page-login")
I've tried with await page.waitForNavigation(), instead of waiting for a selector, and got the same result.
I searched on the internet for a soution but nothing worked for me. I'd be grateful if anyone of you smart people can solve this!