IE test updates
This commit is contained in:
parent
679548cea1
commit
2a35dc5b94
|
@ -312,7 +312,7 @@ private
|
||||||
end
|
end
|
||||||
|
|
||||||
def ie?
|
def ie?
|
||||||
browser_name == :ie
|
%i[internet_explorer ie].include?(browser_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def browser_name
|
def browser_name
|
||||||
|
|
|
@ -176,7 +176,14 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
||||||
|
|
||||||
if parent
|
if parent
|
||||||
siblings = parent.find_xpath(selector)
|
siblings = parent.find_xpath(selector)
|
||||||
selector += "[#{siblings.index(node) + 1}]" unless siblings.size == 1
|
selector += case siblings.size
|
||||||
|
when 0
|
||||||
|
'[ERROR]' # IE doesn't support full XPath (namespace-uri, etc)
|
||||||
|
when 1
|
||||||
|
'' # index not necessary when only one matching element
|
||||||
|
else
|
||||||
|
"[#{siblings.index(node) + 1}]"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
result.push selector
|
result.push selector
|
||||||
end
|
end
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22,10 +22,18 @@ skipped_tests = %i[response_headers status_code trigger modals hover form_attrib
|
||||||
|
|
||||||
$stdout.puts `#{Selenium::WebDriver::IE.driver_path} --version` if ENV['CI']
|
$stdout.puts `#{Selenium::WebDriver::IE.driver_path} --version` if ENV['CI']
|
||||||
|
|
||||||
|
TestSessions::SeleniumIE.current_window.resize_to(1600, 1200)
|
||||||
|
|
||||||
Capybara::SpecHelper.run_specs TestSessions::SeleniumIE, 'selenium', capybara_skip: skipped_tests do |example|
|
Capybara::SpecHelper.run_specs TestSessions::SeleniumIE, 'selenium', capybara_skip: skipped_tests do |example|
|
||||||
case example.metadata[:description]
|
case example.metadata[:full_description]
|
||||||
when /#refresh it reposts$/
|
when /#refresh it reposts$/
|
||||||
skip 'Firefox and Edge insist on prompting without providing a way to suppress'
|
skip 'Firefox and Edge insist on prompting without providing a way to suppress'
|
||||||
|
when /#click_link can download a file$/
|
||||||
|
skip 'Not sure how to configure IE for automatic downloading'
|
||||||
|
when /#fill_in with Date /
|
||||||
|
pending "IE 11 doesn't support date input types"
|
||||||
|
when /#click_link_or_button with :disabled option happily clicks on links which incorrectly have the disabled attribute$/
|
||||||
|
pending "IE 11 obeys non-standard disabled attribute on anchor tag"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -169,11 +169,13 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should generate standard events on changing value' do
|
it 'should generate standard events on changing value' do
|
||||||
|
pending "IE 11 doesn't support date input type" if ie?(session)
|
||||||
session.fill_in('form_date', with: Date.today)
|
session.fill_in('form_date', with: Date.today)
|
||||||
expect(session.evaluate_script('window.capybara_formDateFiredEvents')).to eq %w[focus input change]
|
expect(session.evaluate_script('window.capybara_formDateFiredEvents')).to eq %w[focus input change]
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not generate input and change events if the value is not changed' do
|
it 'should not generate input and change events if the value is not changed' do
|
||||||
|
pending "IE 11 doesn't support date input type" if ie?(session)
|
||||||
session.fill_in('form_date', with: Date.today)
|
session.fill_in('form_date', with: Date.today)
|
||||||
session.fill_in('form_date', with: Date.today)
|
session.fill_in('form_date', with: Date.today)
|
||||||
# Chrome adds an extra focus for some reason - ok for now
|
# Chrome adds an extra focus for some reason - ok for now
|
||||||
|
@ -202,13 +204,15 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'handles namespaces' do
|
it 'handles namespaces' do
|
||||||
|
pending "IE 11 doesn't handle all XPath querys (namespace-uri, etc)" if ie?(session)
|
||||||
session.visit '/with_namespace'
|
session.visit '/with_namespace'
|
||||||
rect = session.find(:css, 'div svg rect')
|
rect = session.find(:css, 'div svg rect:first-of-type')
|
||||||
expect(rect.path).to eq("/HTML/BODY/DIV/./*[((local-name(.) = 'svg') and (namespace-uri(.) = 'http://www.w3.org/2000/svg'))]/./*[((local-name(.) = 'rect') and (namespace-uri(.) = 'http://www.w3.org/2000/svg'))][1]")
|
expect(rect.path).to eq("/HTML/BODY/DIV/./*[((local-name(.) = 'svg') and (namespace-uri(.) = 'http://www.w3.org/2000/svg'))]/./*[((local-name(.) = 'rect') and (namespace-uri(.) = 'http://www.w3.org/2000/svg'))][1]")
|
||||||
expect(session.find(:xpath, rect.path)).to eq rect
|
expect(session.find(:xpath, rect.path)).to eq rect
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'handles case sensitive element names' do
|
it 'handles case sensitive element names' do
|
||||||
|
pending "IE 11 doesn't handle all XPath querys (namespace-uri, etc)" if ie?(session)
|
||||||
session.visit '/with_namespace'
|
session.visit '/with_namespace'
|
||||||
els = session.all(:css, 'div *', visible: :all)
|
els = session.all(:css, 'div *', visible: :all)
|
||||||
expect { els.map(&:path) }.not_to raise_error
|
expect { els.map(&:path) }.not_to raise_error
|
||||||
|
|
Loading…
Reference in New Issue