I have very interesting but also frustrating problem in our tests. Our tests are failing quite frequently with following error (screenshot). I suspect that Playwright starts listening for "load" event too late, after event was actually dispatched.
So I prepared a workaround which dispatches "load" event manually when app initialized. This reduced number of failures significantly but they still happen. I have 100% confidence that I am dispatching this "load" event.
So I started thinking if Playwright is also waiting for load events from iframes that are in the page. I think I recall some code in PW repo that tracks iframe states in the page but I don't remember where it was and what actually it was doing. Hence my question. I would really like to understand how waiting for "load" event works in order to solve this problem in our tests.
This thread is trying to answer question "Does Playwright wait for 'load' event to be fired by all iframes?"
I guess this kinda answers my question https://github.com/microsoft/playwright/pull/16861/files
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 firstname.lastname@example.org.