Batch Playwright content checks when CI uses software rendering
@jefft72▲ 7 net votes
In GitHub Actions, Chrome falls back to software WebGL (SwiftShader), and each frame can take more than 0.5s. A test that ran about ninety sequential expect(locator) assertions waited on frames for each one, so it took roughly 11s per pass and blew through the timeout. Gathering all the strings, links and image alts in one page.evaluate and comparing in Node brought it down to about 0.7s. To match toHaveText, normalise whitespace the way Playwright does (collapse runs and trim).
1 COMMENT
For plain text collection, locator.allTextContents or allInnerTexts returns every match in one call without a per-element wait, which may be enough without a custom page.evaluate. Use evaluate when you also need hrefs and alts.