-
-
Notifications
You must be signed in to change notification settings - Fork 28
Added reduced motion enforcement for behat steps to make the tests more stable. #1945
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| @@ -51,9 +51,9 @@ | ||
| @@ -52,9 +52,9 @@ | ||
| api_driver: drupal | ||
| drush_driver: drush | ||
| drupal: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,14 +36,15 @@ default: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| extra_capabilities: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "goog:chromeOptions": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| args: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-gpu' # Disables hardware acceleration required in containers and cloud-based instances (like CI runners) where GPU is not available. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Options to increase stability and speed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-extensions' # Disables all installed Chrome extensions. Useful in testing environments to avoid interference from extensions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-infobars' # Hides the infobar that Chrome displays for various notifications, like warnings when opening multiple tabs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-popup-blocking' # Disables the popup blocker, allowing all popups to appear. Useful in testing scenarios where popups are expected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-translate' # Disables the built-in translation feature, preventing Chrome from offering to translate pages. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--no-first-run' # Skips the initial setup screen that Chrome typically shows when running for the first time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--test-type' # Disables certain security features and UI components that are unnecessary for automated testing, making Chrome more suitable for test environments. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-extensions' # Disables all installed Chrome extensions. Useful in testing environments to avoid interference from extensions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-gpu' # Disables hardware acceleration required in containers and cloud-based instances (like CI runners) where GPU is not available. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-infobars' # Hides the infobar that Chrome displays for various notifications, like warnings when opening multiple tabs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-popup-blocking' # Disables the popup blocker, allowing all popups to appear. Useful in testing scenarios where popups are expected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. 🧹 Nitpick (assertive) Beware of broad Allowing all popups can introduce flakiness if the app (or extensions, though disabled) triggers unexpected windows/tabs. Prefer opening required popups via explicit user gestures in tests and keep blocking on, unless you have known flows that depend on popups. If no scenarios truly require popups, consider removing this flag. Otherwise, add a Behat step guard that closes/handles new windows deterministically after the popup-triggering action. I can propose a small helper in FeatureContext to detect and close unexpected windows if needed. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--disable-translate' # Disables the built-in translation feature, preventing Chrome from offering to translate pages. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--force-prefers-reduced-motion' # Forces Chrome to respect prefers-reduced-motion CSS media query, disabling animations and transitions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--no-first-run' # Skips the initial setup screen that Chrome typically shows when running for the first time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '--test-type' # Disables certain security features and UI components that are unnecessary for automated testing, making Chrome more suitable for test environments. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+47
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. 🧹 Nitpick (assertive) Minor copy edits in comments for precision Two comment tweaks improve clarity. - - '--disable-extensions' # Disables all installed Chrome extensions. Useful in testing environments to avoid interference from extensions.
+ - '--disable-extensions' # Disables all Chrome extensions to avoid interference during tests.
- - '--force-prefers-reduced-motion' # Forces Chrome to respect prefers-reduced-motion CSS media query, disabling animations and transitions.
+ - '--force-prefers-reduced-motion' # Forces prefers-reduced-motion: reduce; helps disable animations/transitions for deterministic timing.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents🧹 Nitpick (assertive) Consider adding headless, fixed viewport, and /dev/shm mitigations for CI stability For deterministic layouts and fewer CI crashes in containerized environments, it’s typical to include a fixed window size and mitigate shared memory limits. Also, if your stack isn’t already forcing headless via the Selenium image, setting it explicitly improves reproducibility. Apply this diff to extend the args list: args:
# Options to increase stability and speed.
- '--disable-extensions' # Disables all installed Chrome extensions. Useful in testing environments to avoid interference from extensions.
- '--disable-gpu' # Disables hardware acceleration required in containers and cloud-based instances (like CI runners) where GPU is not available.
- '--disable-infobars' # Hides the infobar that Chrome displays for various notifications, like warnings when opening multiple tabs.
- '--disable-popup-blocking' # Disables the popup blocker, allowing all popups to appear. Useful in testing scenarios where popups are expected.
- '--disable-translate' # Disables the built-in translation feature, preventing Chrome from offering to translate pages.
- '--force-prefers-reduced-motion' # Forces Chrome to respect prefers-reduced-motion CSS media query, disabling animations and transitions.
- '--no-first-run' # Skips the initial setup screen that Chrome typically shows when running for the first time.
- '--test-type' # Disables certain security features and UI components that are unnecessary for automated testing, making Chrome more suitable for test environments.
+ - '--disable-dev-shm-usage' # Avoid crashes when /dev/shm is small in Docker; write shared memory files to /tmp instead.
+ - '--headless=new' # Ensure headless mode explicitly for CI consistency (Chrome 109+).
+ - '--window-size=1365,768' # Fixed viewport for deterministic responsive breakpoints and screenshots.Note: if the Selenium image already runs Chrome headless, including If you prefer not to enable headless, at least keep 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Provides integration with Drupal APIs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Drupal\DrupalExtension: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧹 Nitpick (assertive)
Re-evaluate
--disable-gpuusage in modern headless runsIn modern Chrome headless (
--headless=new),--disable-gpuis generally unnecessary; Chrome won’t attempt to use a GPU. Keeping it doesn’t usually hurt, but it’s redundant and can be removed to simplify the set. If you keep it, tweak the comment for clarity.Apply this diff to improve the comment:
If your environment is non-headless (e.g., XVFB), keeping
--disable-gpumay still be useful. Please confirm how Chrome is launched in your Selenium container.🤖 Prompt for AI Agents