Skip to content

Commit

Permalink
minor style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed May 7, 2022
1 parent 5c8e975 commit 34493f0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/capybara/node/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def scroll_to(pos_or_el_or_x, y = nil, align: :top, offset: nil)

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

##
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selenium/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def silenced_unknown_error_messages
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)

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selenium/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def rect
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/has_selector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion spec/shared_selenium_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
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

Expand Down

0 comments on commit 34493f0

Please sign in to comment.