This thread is trying to answer question "Is there a way to wait for 'data-hydrated' flag on every page change globally?"
You mean like this:
this.page.on("domcontentloaded", async () => {
await this.page.locator("[data-hydrated]").waitFor()
})
Will it wait for the async promise?
I already did that actually and it works very well. However, right now we call the page.reload
only on the playwright page (not a self written POM), since it's global operation and has nothing to do with a specific page. we only do goto
on actual pages like, profilePage.goto()
.
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].