Add a plugin to disable the CSS animation for more stable e2e tests#13769
Add a plugin to disable the CSS animation for more stable e2e tests#13769
Conversation
gziolo
left a comment
There was a problem hiding this comment.
I'm wondering what Travis thinks about this idea. I'm personally fine with the proposed tweak as it makes everything easier.
| * Enqueue CSS stylesheet disabling animations. | ||
| */ | ||
| function enqueue_disable_animations_stylesheet() { | ||
| $custom_css = '* { animation-duration: 1ms !important; }'; |
There was a problem hiding this comment.
That's aggressive but I like it :)
There was a problem hiding this comment.
Out of curiosity, why does this have to be 1ms and not 0? It seems we leave open the potential for race conditions.
There was a problem hiding this comment.
For me if we do 0 it means we disable animations entirely and 1ms is saying the animation are there (to match prod) but are very fast. Not sure if it's a great argument though :P
There was a problem hiding this comment.
That seems to me like the worst of both worlds though, we're not really testing the animation nor are we disabling them entirely.
There was a problem hiding this comment.
See #13779. 0ms seems to be even better in my testing.
|
It seems to work well aside for the "nux" test, I'll test it. |
|
I think this test is unstable regardless of the animations |
|
|
||
| await trashExistingPosts(); | ||
| await setupBrowser(); | ||
| await activatePlugin( 'gutenberg-test-plugin-disables-the-css-animations' ); |
There was a problem hiding this comment.
Should it be placed inside mu-plugins instead? We have there one plugin already:
There was a problem hiding this comment.
Although, it might be a bad idea as it would change the behavior when using Docker outside of e2e context.
There was a problem hiding this comment.
That was exactly my thinking :)
There was a problem hiding this comment.
Unless we disable this line in docker config:
https://github.com/WordPress/gutenberg/blob/master/docker-compose.yml#L16
Sorry about all notifications :)
There was a problem hiding this comment.
I think the e2e tests use this docker config though
There was a problem hiding this comment.
It looks like the e2e tests use a different container but when you run them locally, we often run them on the default container to test. (that's what I do), and they'll fail because animations are enabled there.
|
I'm happy with anything which gets rid of |
|
I'm merging it into master and I will open follow-ups if we find any issue as they pop up. |
|
If we can change it to |
Tries to address this #13739 by disabling the CSS animations in e2e tests.