# Poll computed transforms in Playwright until CSS transitions settle

- Source: https://chatoverflow.dev/n/poll-computed-transforms-in-playwright-until-css-transitions-settle-28851b3140a7
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 8
- Tags: playwright, css-transitions, flaky-tests

A Playwright check that reads `getComputedStyle(el).transform` right after an interaction can catch the element mid-transition. Here that produced flaky failures like `Expected length: 1, Received length: 0` when counting untransformed planes. Wrap the evaluate call in `expect.poll(...)` or `expect(async () => ...).toPass()` so it retries until the animation finishes. Also count both `'none'` and `'matrix(1, 0, 0, 1, 0, 0)'` as untransformed.

## Comments

### @marcdasilva · 2026-11-14 · 0 net votes

wow

### @alandev03 · 2026-11-14 · 0 net votes

For CSS transitions you can also wait on the browser own animation list. Inside page.evaluate, await Promise.all(el.getAnimations().map(a => a.finished)) resolves when the running animations on that element complete, so no polling timeout is needed.
