You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Introduce browser_family guard derived from the existing browser test environment.
• Update integration specs to use browser_family for Chromium/Safari-wide skips/pending/flaky.
• Document browser_family usage and guidance to prefer families over enumerating browsers.
The following are alternative approaches to this PR:
1. Extend `browser` condition to support named groups
➕ Avoids introducing a new condition key
➕ Keeps all browser matching logic in one place
➖ More magical semantics for browser values (symbols meaning either concrete browser or group)
➖ Harder to document and reason about than an explicit browser_family key
2. Add a more explicit `browser_engine` condition
➕ Terminology aligns with the underlying rendering/automation engine concept
➕ Scales if you later need :gecko/:webkit/:chromium as engines
➖ Naming bikeshed and potential mismatch with existing project vocabulary
➖ Requires migrating specs similarly, with no practical win over browser_family today
Recommendation:browser_family is the best trade-off here: it is explicit, derived from existing configuration (no new env vars), and makes guards more readable/maintainable while keeping channel-specific cases (:safari_preview, Chrome beta, etc.) on the existing browser condition.
Files changed (25) +105 / -83
Enhancement (2) +12 / -0
spec_helper.rbRegister 'browser_family' as a guard condition for examples+1/-0
Register 'browser_family' as a guard condition for examples
• Adds ':browser_family' to the guard condition set so metadata can match on browser engine family.
test_environment.rbDerive 'browser_family' from the selected browser+11/-0
Derive 'browser_family' from the selected browser
• Introduces a 'browser_family' helper that maps Chrome/Edge to ':chromium' and Safari/Safari Preview to ':safari', otherwise returning the original browser symbol.
window_spec.rbApply 'browser_family' to window management pending/skip/flaky guards+4/-4
Apply 'browser_family' to window management pending/skip/flaky guards
• Converts Chrome/Edge and Safari/Safari Preview guards to 'browser_family: :chromium' and 'browser_family: :safari' respectively for fullscreen/minimize-related metadata.
TESTING.mdDocument new 'browser_family' guard and usage guidance+10/-0
Document new 'browser_family' guard and usage guidance
• Adds 'browser_family' to the guard conditions table and explains when it should be preferred over enumerating browsers. Includes a new example showing 'pending_if: {browser_family: :chromium}'.
The PR introduces new browser_family derivation logic used for many guards, but does not add any
unit/spec coverage to validate the mapping for key browsers (e.g., :chrome/:edge → :chromium,
:safari_preview → :safari). This makes guard behavior prone to silent regressions and unexpected
spec skipping/pending.
+ def browser_family+ case browser+ when :chrome, :edge+ :chromium+ when :safari, :safari_preview+ :safari+ else+ browser+ end+ end
Evidence
PR Compliance ID 3 requires adding tests for new features when feasible. The PR adds new behavior
(browser_family mapping) at the cited lines, but no accompanying unit/spec asserts the expected
mapping outcomes.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`TestEnvironment#browser_family` was added/changed without direct test coverage, so its browser-to-family mapping can regress and silently change which specs are skipped/pending.
## Issue Context
The new `browser_family` condition is now used widely across integration specs, so a small mapping error can affect large portions of the test suite.
## Fix Focus Areas
- rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb[69-78]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B-devtoolsIncludes everything BiDi or Chrome DevTools relatedC-rbRuby Bindings
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issues
💥 What does this PR do?
browser_familyspec guard to simplify expressions🔧 Implementation Notes
:chromiumfor all edge/chrome and:safarifor safari and tech previewbrowservalue inTestEnvironment, so no new environment variable🤖 AI assistance
browser_familyderivation, guard conversions, and docs🔄 Types of changes