I’m adding a couple of animations to an app that has Percy taking snapshots in the cypress tests.
I’m trying to figure out a way to wait for the animations to finish before taking the snapshot.
I’m aware that cypress already does that by default according to the docs. But it seems that it only waits until the element is safe for an ACTION, but not regular assertions.
Let’s use my logo animation for example. It slides from the left to center. The flaky tests capture the snapshot anywhere in its path.
Now, just for a test, I asked cypress to click the logo and then Percy works alright, the snapshot is only taken at the end of the animation.
For this case it’s ok, since my logo does not have an action related to it. But what if clicking it had a redirect, for example?
How can I tell cypress to wait without using an action?