const isLoginOk = await page.evaluate(() => {
return new Promise(function (resolve) {
window.EV.Event.on(window.EV.Event.LOGIN_SUCCESS, (ev) => { // <<---------- event is never received, never enters here
console.log('LOGIN SUCCESS');
resolve(true);
});
});
});
await loginSubmitButon.click();
expect(isLoginOk).toBeTruthy();
This thread is trying to answer question "Why is the 'login' event message sent to a global JS variable window.EV not being received, causing a test to enter into a loop and never end?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].