mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
EdgeChrome can't click on file inputs
This commit is contained in:
parent
4c3bbc473d
commit
724e245b6e
2 changed files with 16 additions and 18 deletions
|
@ -36,14 +36,16 @@ class Capybara::Selenium::EdgeNode < Capybara::Selenium::Node
|
|||
html5_drop(*args)
|
||||
end
|
||||
|
||||
# def click(*)
|
||||
# super
|
||||
# rescue ::Selenium::WebDriver::Error::WebDriverError => e
|
||||
# # chromedriver 74 (at least on mac) raises the wrong error for this
|
||||
# raise ::Selenium::WebDriver::Error::ElementClickInterceptedError, e.message if e.message.match?(/element click intercepted/)
|
||||
#
|
||||
# raise
|
||||
# end
|
||||
def click(*)
|
||||
super
|
||||
rescue Selenium::WebDriver::Error::InvalidArgumentError => e
|
||||
tag_name, type = attrs(:tagName, :type).map { |val| val&.downcase }
|
||||
if tag_name == 'input' && type == 'file'
|
||||
raise Selenium::WebDriver::Error::InvalidArgumentError, "EdgeChrome can't click on file inputs.\n#{e.message}"
|
||||
end
|
||||
|
||||
raise
|
||||
end
|
||||
|
||||
def disabled?
|
||||
return super unless chrome_edge?
|
||||
|
|
|
@ -7,7 +7,7 @@ require 'shared_selenium_node'
|
|||
require 'rspec/shared_spec_matchers'
|
||||
|
||||
# unless ENV['CI']
|
||||
# Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
|
||||
# Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
|
||||
# end
|
||||
|
||||
if ::Selenium::WebDriver::Platform.mac?
|
||||
|
@ -30,17 +30,13 @@ end
|
|||
|
||||
skipped_tests = %i[response_headers status_code trigger]
|
||||
|
||||
Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::Edge) if ENV['CI']
|
||||
Capybara::SpecHelper.log_selenium_driver_version(Selenium::WebDriver::EdgeChrome) if ENV['CI']
|
||||
|
||||
Capybara::SpecHelper.run_specs TestSessions::SeleniumEdge, 'selenium', capybara_skip: skipped_tests do |example|
|
||||
# case example.metadata[:description]
|
||||
# when /#refresh it reposts$/
|
||||
# skip 'Edge insists on prompting without providing a way to suppress'
|
||||
# when /should be able to open non-http url/
|
||||
# skip 'Crashes'
|
||||
# when /when Capybara.always_include_port is true/
|
||||
# skip 'Crashes'
|
||||
# end
|
||||
case example.metadata[:full_description]
|
||||
when 'Capybara::Session selenium #attach_file with a block can upload by clicking the file input'
|
||||
pending "EdgeChrome doesn't allow clicking on file inputs"
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.describe 'Capybara::Session with Edge', capybara_skip: skipped_tests do
|
||||
|
|
Loading…
Add table
Reference in a new issue