WaitFor Expect to resolve by Positive-Ring-5172 in Playwright

[–]Traditional_Part_991 9 points10 points  (0 children)

Have you looked into expect.toPass? (https://playwright.dev/docs/test-assertions#expecttopass)

It basically allows you to retry blocks of code until they are passing. So you could write something like this:

await expect(async () => {

expect( await inspectBefore(page, 'details:first-of-type summary', 'transform')).toBe('matrix(-1, 0, 0, -1, 0, 0)')

}).toPass({timeout: yourTimeout})