-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a plugin to disable the CSS animation for more stable e2e tests #13769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's aggressive but I like it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -154,6 +155,7 @@ beforeAll( async () => { | |||
|
|||
await trashExistingPosts(); | |||
await setupBrowser(); | |||
await activatePlugin( 'gutenberg-test-plugin-disables-the-css-animations' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be placed inside mu-plugins
instead? We have there one plugin already:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was exactly my thinking :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the e2e tests use this docker config though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the proposed solution. @aduth any thoughts before we proceed?
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.