From bb05112ec5249aca0b3f140b54ec3e1c8a72d222 Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Tue, 13 Oct 2026 22:39:24 +0300 Subject: [PATCH 1/3] ref(js): match top-layer selectors in a single call --- lib/capybara/cuprite/javascripts/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/cuprite/javascripts/index.js b/lib/capybara/cuprite/javascripts/index.js index b0733b0..6329461 100644 --- a/lib/capybara/cuprite/javascripts/index.js +++ b/lib/capybara/cuprite/javascripts/index.js @@ -92,7 +92,7 @@ class Cuprite { // an ancestor's opacity no longer applies to it once shown. if (ancestorOpacityApplies) { try { - if (node.matches(":modal") || node.matches(":popover-open")) { + if (node.matches(":modal, :popover-open")) { ancestorOpacityApplies = false; } } catch (e) {} From 86cd56e45c6e4f952cb13a394603876bc84607cb Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Tue, 13 Oct 2026 22:39:24 +0300 Subject: [PATCH 2/3] test(visible): cover a child of a shown popover under opacity: 0 --- spec/features/session_spec.rb | 10 ++++++++++ spec/support/views/visible.erb | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/features/session_spec.rb b/spec/features/session_spec.rb index 752d2c7..54e113f 100644 --- a/spec/features/session_spec.rb +++ b/spec/features/session_spec.rb @@ -420,6 +420,16 @@ expect(popover.visible?).to be true end + it "considers a child of a shown popover to be visible past opacity: 0" do + button = @session.find(:css, "#button_in_popover", visible: false) + expect(button.visible?).to be false + + @session.execute_script("document.getElementById('popover_in_transparent').showPopover()") + + expect(button.visible?).to be true + button.click + end + it "considers a shown modal dialog to be visible past opacity: 0" do dialog = @session.find(:css, "#dialog_in_transparent", visible: false) expect(dialog.visible?).to be false diff --git a/spec/support/views/visible.erb b/spec/support/views/visible.erb index 8733bae..fb82905 100644 --- a/spec/support/views/visible.erb +++ b/spec/support/views/visible.erb @@ -16,7 +16,10 @@ Hidden
-
Popover In Transparent
+
+ Popover In Transparent + +
Dialog In Transparent
From 496af19b6377d2d8eb8cb34c4c4c86893edbbae4 Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Tue, 13 Oct 2026 22:39:24 +0300 Subject: [PATCH 3/3] docs(changelog): add popover visibility fix and point Unreleased link to cuprite --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d025e2..bdd2e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [Unreleased](https://github.com/rubycdp/ferrum/compare/v0.18...main) ## +## [Unreleased](https://github.com/rubycdp/cuprite/compare/v0.18...main) ## ### Added @@ -8,6 +8,7 @@ - `Driver#reset!` kept the page it had cached when the browser failed to reset, so every later example raised `Session with given id not found` or `Browser is dead or given window is closed` instead of starting on a fresh page [#274], [rubycdp/ferrum#641] +- `Node#visible?` reported an open popover or modal dialog as hidden when an ancestor had `opacity: 0` [#328] ### Removed