"disable_animation" doesn't disable animation

18 views
Skip to first unread message

Carl Quivron

unread,
Nov 25, 2022, 11:30:24 AM11/25/22
to Capybara
Hi there,

I've come a long way to understand that my flaky tests are caused Capybara.disable_animation not setting animation: none !important;
https://github.com/teamcapybara/capybara/blob/master/lib/capybara/server/animation_disabler.rb#L66

Is there any specific reason for that ? A PR would be accepted ?

Thanks

Carl Quivron

unread,
Dec 6, 2022, 6:16:02 AM12/6/22
to Capybara
Anyone ?

Thomas Walpole

unread,
Dec 7, 2022, 9:08:15 PM12/7/22
to Capybara
The reason is because that would prevent `animationend` events from firing which will break some peoples code. `Capybara.disable_animation` does best effort without intentionally breaking things.  If you know your code is safe to do more disabling then you should write your own middleware for use during tests.

Carl Quivron

unread,
Dec 8, 2022, 6:11:43 AM12/8/22
to Capybara
Thanks for your answer !
Any tips/resources on how to add this middleware ?
Reply all
Reply to author
Forward
0 new messages