Skip to content

Commit 8d37d1f

Browse files
authored
Report tag_name as ShadowRoot for shadow roots (#318)
1 parent 872cfd3 commit 8d37d1f

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

lib/capybara/cuprite/node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def unselect_option
139139
end
140140

141141
def tag_name
142-
@tag_name ||= description["nodeName"].downcase
142+
@tag_name ||= description["shadowRootType"] ? "ShadowRoot" : description["nodeName"].downcase
143143
end
144144

145145
def visible?

spec/features/session_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
shadow_root = @session.find(:css, "#shadow_host").shadow_root
453453
expect do
454454
expect(shadow_root).to have_css("#shadow_content", text: "Not in the document")
455-
end.to raise_error(/tag="#document-fragment"/)
455+
end.to raise_error(/tag="ShadowRoot"/)
456456
end
457457

458458
it "extends visibility check across shadow host boundary" do

spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ module TestSessions
5959
node #visible? details non-summary descendants should be non-visible
6060
node #visible? works when details is toggled open and closed
6161
node #set should submit single text input forms if ended with
62-
node #shadow_root should produce error messages when failing
6362
#has_field with valid should be false if field is invalid
6463
#has_element? should be true if the given element is on the page
6564
#assert_matches_style should raise error if the elements style doesn't contain the given properties

0 commit comments

Comments
 (0)