Anticipate Timeout-Exceptions on UI tests (MGNLTEST-208)

[MGNLTEST-209] Skip css animations during test executions Created: 01/Apr/22  Updated: 18/May/22  Resolved: 05/May/22

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.1

Type: Sub-task Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Resolved Votes: 0
Labels: VN-Testing, foundation_team
Remaining Estimate: Not Specified
Time Spent: 1d 7h
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLUI-7136 Enable to skip css-animation by prefe... Closed
Template:
Date of First Response:

 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):



 Comments   
Comment by Christoph Meier [ 06/Apr/22 ]

--wm-window-animations-disabled didn't do the trick.

Next thing to try out, via CSS. See:

 

Comment by Maxime Michel [ 14/Apr/22 ]

FTR https://caniuse.com/?search=prefers-reduced-motion

Comment by Christoph Meier [ 26/Apr/22 ]

A few thoughts

About injecting the CSS via JavaScript / JavaScriptExecutor of Selenium

  • What happens after the login? Do we get a new page?
  • NEW PAGE:
    • We must inject it rather after the login
    • In this case - it is likely better to add the code as pure CSS in UI/AdminCentral
  • Not a new page
    • All good … injecting va script/script-executor should be fine

How to enable the skip-animation

  • IF added / injected via script/script-executor
    • Can be enabled always
    • Optionally adding the ability to control via Annotation
      • But what we gain from it?
  • IF added by sole CSS / on ui/Admincentral level, with media query:
    @media screen and (prefers-reduced-motion: reduce) { /* css-code here */ }

Conclusion:

  • Adding the CSS with plain file on Admincentral is more reliable & safe.
Comment by Christoph Meier [ 05/May/22 ]

reviewed and integrated

Generated at Mon Feb 12 07:46:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.