-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Gutenberg Test Plugin, Disables the CSS animations | ||
* Plugin URI: https://github.com/WordPress/gutenberg | ||
* Author: Gutenberg Team | ||
* | ||
* @package gutenberg-test-disable-animations | ||
*/ | ||
|
||
/** | ||
* 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, why does this have to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me if we do There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. See #13779. |
||
wp_add_inline_style( 'wp-components', $custom_css ); | ||
} | ||
|
||
add_action( 'enqueue_block_editor_assets', 'enqueue_disable_animations_stylesheet' ); |
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:https://github.com/WordPress/gutenberg/blob/master/packages/e2e-tests/mu-plugins/disable-login-autofocus.php
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.