From c3570977a144a4ea9808f5b19176715810d03999 Mon Sep 17 00:00:00 2001 From: Kai Hao Date: Tue, 10 Aug 2021 13:27:09 +0800 Subject: [PATCH] Disable transition --- .../specs/widgets/customizing-widgets.test.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/e2e-tests/specs/widgets/customizing-widgets.test.js b/packages/e2e-tests/specs/widgets/customizing-widgets.test.js index 76a9614f593ef..d47cfb89337f1 100644 --- a/packages/e2e-tests/specs/widgets/customizing-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/customizing-widgets.test.js @@ -44,6 +44,20 @@ describe( 'Widgets Customizer', () => { await deactivatePlugin( 'gutenberg-test-plugin-disables-the-css-animations' ); + // Disable the transition timing function to make it "snap". + // We can't disable all the transitions yet because of #32024. + await page.evaluateOnNewDocument( () => { + const style = document.createElement( 'style' ); + style.innerHTML = ` + * { + transition-timing-function: step-start !important; + animation-timing-function: step-start !important; + } + `; + window.addEventListener( 'DOMContentLoaded', () => { + document.head.appendChild( style ); + } ); + } ); await activatePlugin( 'gutenberg-test-widgets' ); } ); @@ -204,15 +218,6 @@ describe( 'Widgets Customizer', () => { await expect( inspectorHeading ).not.toBeVisible(); - // Wait for the transition to finish to prevent it from - // clicking on the wrong element. - // The transition takes 180ms, 200ms should be enough. - // This is a temporary solution, a more ideal alternative - // would be to disable the transition entirely. - // See https://github.com/WordPress/gutenberg/pull/33875#issuecomment-893122147 - // eslint-disable-next-line no-restricted-syntax - await page.waitForTimeout( 200 ); - await clickBlockToolbarButton( 'Options' ); showMoreSettingsButton = await find( { role: 'menuitem',