Details
-
Sub-task
-
Resolution: Resolved
-
Neutral
-
None
Description
When looking at vids of failed tests - we can see "frozen" animations - looks a bit like we see more than one "frame", elements of contents-apps seem to miss, etc. Thus skipping the animations - if doable "easy" could help on the issue.
How we do/dit it finally?
Adding css via UI project with the vaadin theme using the media query:
@media (prefers-reduced-motion: reduce)
And in test-fwk we call the chrome-driver with the flag force-prefers-reduced-motion.
Developer note:
the command line flag
--wm-window-animations-disabled
should do the trick. Most likely can be added as an arg in ChromeOptions at info.magnolia.test.selenium.Selenium#getNewChromeDriver
Just a hunch (perhaps a bit hackish):
- Provide a @DisableCssAnimations annotation you can apply at method level.
- When the driver is created at info.magnolia.test.selenium.Selenium#resolveParameter, use Selenium's ability to execute JS https://www.browserstack.com/guide/javascriptexecutor-in-selenium to inject a custom css, say .disable-css-animations in DOM, something like https://marcgg.com/blog/2015/01/05/css-animations-failing-capybara-specs/
(see also https://stackoverflow.com/questions/51050533/injecting-css-like-html-through-javascript-into-the-dom) - If annotation is present, add the custom style to the body of the page still using Selenium's JS executor, e.g. in beforeEach method
- finally remove custom style in afterEach
Attachments
Issue Links
- depends upon
-
MGNLUI-7136 Enable to skip css-animation by prefers-reduced-motion
-
- Closed
-