-
-
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
Conversation
WalkthroughUpdate to behat.yml modifies Selenium Chrome options: reorders goog:chromeOptions args, adds --force-prefers-reduced-motion, and aligns inline comments with their respective flags. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
.vortex/installer/tests/Fixtures/install/_baseline/behat.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/hosting_acquia/behat.ymlis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
behat.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: build (1)
- GitHub Check: build (0)
- GitHub Check: vortex-test-installer (8.4)
- GitHub Check: vortex-test-installer (8.3)
- GitHub Check: vortex-test-installer (8.2)
- GitHub Check: vortex-test-deployment (1)
- GitHub Check: vortex-test-workflow (3)
- GitHub Check: vortex-test-deployment (0)
- GitHub Check: vortex-test-workflow (1)
- GitHub Check: vortex-test-workflow (2)
- GitHub Check: vortex-test-workflow (0)
- GitHub Check: vortex-test-common
- GitHub Check: vortex-test-docs
🔇 Additional comments (1)
behat.yml (1)
45-45: Confirmed:--force-prefers-reduced-motionIs Supported in Your CI Chrome Image
- The switch appears in the official Chromium command-line switches list (last updated 2025-08-24), confirming it’s present in current stable Chrome builds (peter.sh).
- The underlying CSS media query (
prefers-reduced-motion) has been supported since Chrome 74 (caniuse.com).- Headless Chrome respects this flag just like desktop mode; there are no known headless-specific caveats.
(Optional) You can still add the sanity check in your
FeatureContextto assert at runtime thatwindow.matchMedia('(prefers-reduced-motion: reduce)').matchesistrue.
| - '--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. |
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)
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
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - '--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-extensions' # Disables all Chrome extensions to avoid interference during tests. | |
| - '--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 prefers-reduced-motion: reduce; helps disable animations/transitions for deterministic timing. | |
| - '--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. |
🤖 Prompt for AI Agents
In behat.yml around lines 40 to 47, two comment lines need minor copy edits for
precision: update the '--disable-infobars' comment to clearly state it hides
Chrome's automation/info bar used for automation warnings (e.g., "Hides Chrome's
infobar that notifies about automation or other messages."), and tighten the
'--test-type' comment to indicate it suppresses test-related security warnings
and should be used cautiously (e.g., "Suppresses security/UI warnings related to
automated testing; use with caution."). Apply these two concise comment
replacements to improve clarity.
🧹 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 --headless=new is harmless and documents intent.
If you prefer not to enable headless, at least keep --window-size=... to stabilize breakpoints and screenshot dimensions.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - '--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. | |
| 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. |
🤖 Prompt for AI Agents
In behat.yml around lines 40-47, the Chrome args lack explicit headless, fixed
viewport and /dev/shm mitigations which improve CI stability; append flags to
the args list: add --headless=new (or omit if you deliberately don’t want
headless), add a fixed window size such as --window-size=1366,768 to stabilize
layouts/screenshots, and add --disable-dev-shm-usage to mitigate container
shared-memory crashes; update the YAML args array to include those three flags
(or at minimum keep --window-size if you opt out of headless).
| - '--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. |
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-gpu usage in modern headless runs
In modern Chrome headless (--headless=new), --disable-gpu is 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:
- - '--disable-gpu' # Disables hardware acceleration required in containers and cloud-based instances (like CI runners) where GPU is not available.
+ - '--disable-gpu' # Redundant in modern headless Chrome; safe to remove. Keep only if running non-headless in environments without GPU.If your environment is non-headless (e.g., XVFB), keeping --disable-gpu may still be useful. Please confirm how Chrome is launched in your Selenium container.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In behat.yml around line 42, the comment for the Chrome flag `--disable-gpu`
should be updated: either remove the `--disable-gpu` flag if you run Chrome with
modern headless mode (`--headless=new`) because it’s redundant, or keep the flag
but change the comment to note it’s only needed for non-headless or XVFB
environments; also add a short verification note requesting confirmation of how
Chrome is launched in the Selenium container (headless vs XVFB) so the team can
decide to remove or retain the flag.
| - '--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 comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Beware of broad --disable-popup-blocking; can surface non-deterministic popups
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
In behat.yml around line 43, the configuration includes the broad
'--disable-popup-blocking' flag which may allow unexpected popups and introduce
flakiness; remove this flag if no scenarios require popups, or keep it only when
needed and add deterministic handling in tests. If popups are required, revert
the flag to keep blocking by default and implement a Behat step/helper in
FeatureContext that, immediately after the action that triggers a popup, detects
any new window handles and closes or switches back to the main window
programmatically to ensure deterministic behavior; alternatively, add a guarded
step to explicitly open popups via simulated user gestures so tests remain
stable.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1945 +/- ##
========================================
Coverage 76.26% 76.26%
========================================
Files 87 87
Lines 5392 5392
Branches 35 35
========================================
Hits 4112 4112
Misses 1280 1280 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit