1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

minor style updates

This commit is contained in:
Thomas Walpole 2022-05-07 16:52:01 -07:00
parent 5c8e975d5c
commit 34493f0386
5 changed files with 5 additions and 5 deletions

View file

@ -480,7 +480,7 @@ module Capybara
def shadow_root
root = synchronize { base.shadow_root }
root && Capybara::Node::Element.new(self.session, root, nil, nil)
root && Capybara::Node::Element.new(session, root, nil, nil)
end
##

View file

@ -473,7 +473,7 @@ private
end
def unwrap_script_result(arg)
# TODO - move into the case when we drop support for Selenium < 4.1
# TODO: move into the case when we drop support for Selenium < 4.1
element_types = [Selenium::WebDriver::Element]
element_types.push(Selenium::WebDriver::ShadowRoot) if defined?(Selenium::WebDriver::ShadowRoot)

View file

@ -220,7 +220,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
end
def shadow_root
raise_error "You must be using Selenium 4.1+ for shadow_root support" unless native.respond_to? :shadow_root
raise_error 'You must be using Selenium 4.1+ for shadow_root support' unless native.respond_to? :shadow_root
root = native.shadow_root
root && build_node(native.shadow_root)

View file

@ -117,7 +117,7 @@ Capybara::SpecHelper.spec '#has_selector?' do
expect(@session).to have_selector(:id, 'h2one', text: 'Header Class Test One', exact_text: false)
expect(@session).to have_selector(:id, 'h2one', text: 'Header Class Test', exact_text: false)
end
it 'should warn if text option is a regexp that it is ignoring exact_text' do
allow(Capybara::Helpers).to receive(:warn)
expect(@session).to have_selector(:id, 'h2one', text: /Class Test/, exact_text: true)

View file

@ -283,7 +283,7 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
it 'returns a shadow root' do
session.visit('/with_shadow')
shadow = session.find(:css, '#shadow_host')
element = session.evaluate_script("arguments[0].shadowRoot", shadow)
element = session.evaluate_script('arguments[0].shadowRoot', shadow)
expect(element).to be_instance_of(Capybara::Node::Element)
end