Skip to content

Commit

Permalink
Fix MS Edge Click (Button) to Support Ruby 3 Separation of Positional…
Browse files Browse the repository at this point in the history
… and Keyword Arguments (#2652)

* Rename Selenium edge chrome to just edge

* Fix EdgeNode#click to use Ruby 3 arguments
  • Loading branch information
brianjbayer committed Mar 20, 2023
1 parent f857a99 commit f83431d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/capybara/selenium/nodes/edge_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def drop(*args)
html5_drop(*args)
end

def click(*)
def click(*, **)
super
rescue Selenium::WebDriver::Error::InvalidArgumentError => e
tag_name, type = attrs(:tagName, :type).map { |val| val&.downcase }
Expand Down
8 changes: 4 additions & 4 deletions spec/selenium_spec_edge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# end

if Selenium::WebDriver::Platform.mac?
Selenium::WebDriver::EdgeChrome.path = '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev'
Selenium::WebDriver::Edge.path = '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'
end

Capybara.register_driver :selenium_edge do |app|
# ::Selenium::WebDriver.logger.level = "debug"
# If we don't create an options object the path set above won't be used
browser_options = Selenium::WebDriver::EdgeChrome::Options.new
Capybara::Selenium::Driver.new(app, browser: :edge_chrome, options: browser_options).tap do |driver|
browser_options = Selenium::WebDriver::Edge::Options.new
Capybara::Selenium::Driver.new(app, browser: :edge, options: browser_options).tap do |driver|
driver.browser
driver.download_path = Capybara.save_path
end
Expand All @@ -30,7 +30,7 @@ module TestSessions

skipped_tests = %i[response_headers status_code trigger]

Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::EdgeChrome) if ENV['CI']
Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::Edge) if ENV['CI']

Capybara::SpecHelper.run_specs TestSessions::SeleniumEdge, 'selenium', capybara_skip: skipped_tests do |example|
case example.metadata[:full_description]
Expand Down

0 comments on commit f83431d

Please sign in to comment.