Skip to content

Commit

Permalink
test(integration): delay screenshots slightly to avoid JS animations
Browse files Browse the repository at this point in the history
We've seen some nondeterministic failures in CI due to animation race conditions. It seems like these animations are JavaScript based rather than CSS, and there's not a way to disable them. This change adds a 300-millisecond delay before taking the screenshot, which seems to be the default duration (https://github.com/mui-org/material-ui/blob/174b64f8a3adffb8df3c13285f4edc2437a8547a/packages/material-ui/src/internal/animate.js#L8).

Delays are never ideal, but I can't see another approach at the moment. It's also unclear whether this is enough for CI to pass, as the failure rate is far lower locally.

Refs #388, d546124, c12bc98, mui/material-ui#16367
  • Loading branch information
thewilkybarkid committed Nov 26, 2021
1 parent d546124 commit a51f503
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions integration/src/browser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function screenshot(
const frame = await getFrame(item);

await Promise.all([
frame.waitForTimeout(300),
hideTwitterTimelines(frame),
resetCarousels(frame),
removeAnimations(frame),
Expand Down

0 comments on commit a51f503

Please sign in to comment.