Adjustments for tests on Windows platform and skip HTML5 drag tests in IE
This commit is contained in:
parent
1f51047576
commit
055abbb583
|
@ -468,7 +468,7 @@ end
|
|||
|
||||
Capybara.add_selector(:element) do
|
||||
xpath do |locator, **|
|
||||
xp = XPath.descendant.where(locator ? XPath.local_name == locator.to_s : nil)
|
||||
XPath.descendant.where(locator ? XPath.local_name == locator.to_s : nil)
|
||||
end
|
||||
|
||||
expression_filter(:attributes, matcher: /.+/) do |xpath, name, val|
|
||||
|
|
|
@ -45,7 +45,12 @@ skipped_tests << :windows if ENV['TRAVIS'] && (ENV['SKIP_WINDOW'] || ENV['HEADLE
|
|||
|
||||
$stdout.puts `#{Selenium::WebDriver::Chrome.driver_path} --version` if ENV['CI']
|
||||
|
||||
Capybara::SpecHelper.run_specs TestSessions::Chrome, CHROME_DRIVER.to_s, capybara_skip: skipped_tests
|
||||
Capybara::SpecHelper.run_specs TestSessions::Chrome, CHROME_DRIVER.to_s, capybara_skip: skipped_tests do |example|
|
||||
case example.metadata[:full_description]
|
||||
when /#click_link can download a file$/
|
||||
skip 'Need to figure out testing of file downloading on windows platform' if Gem.win_platform?
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.describe 'Capybara::Session with chrome' do
|
||||
include Capybara::SpecHelper
|
||||
|
|
|
@ -51,7 +51,7 @@ $stdout.puts `#{Selenium::WebDriver::Firefox.driver_path} --version` if ENV['CI'
|
|||
Capybara::SpecHelper.run_specs TestSessions::SeleniumMarionette, 'selenium', capybara_skip: skipped_tests do |example|
|
||||
case example.metadata[:full_description]
|
||||
when 'Capybara::Session selenium node #click should allow multiple modifiers'
|
||||
pending "Firefox doesn't generate an event for shift+control+click" if marionette_gte?(62, @session)
|
||||
pending "Firefox doesn't generate an event for shift+control+click" if marionette_gte?(62, @session) && !Gem.win_platform?
|
||||
when /^Capybara::Session selenium node #double_click/
|
||||
pending "selenium-webdriver/geckodriver doesn't generate double click event" if marionette_lt?(59, @session)
|
||||
when 'Capybara::Session selenium #accept_prompt should accept the prompt with a blank response when there is a default'
|
||||
|
@ -63,6 +63,8 @@ Capybara::SpecHelper.run_specs TestSessions::SeleniumMarionette, 'selenium', cap
|
|||
pending "FF < 62 doesn't support setting all files at once" if marionette_lt?(62, @session)
|
||||
when 'Capybara::Session selenium #accept_confirm should work with nested modals'
|
||||
skip 'Broken in FF 63 - https://bugzilla.mozilla.org/show_bug.cgi?id=1487358' if marionette_gte?(63, @session)
|
||||
when 'Capybara::Session selenium #click_link can download a file'
|
||||
skip 'Need to figure out testing of file downloading on windows platform' if Gem.win_platform?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -294,8 +294,12 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
end
|
||||
|
||||
describe 'Element#drag_to' do
|
||||
before do
|
||||
skip "Firefox < 62 doesn't support a DataTransfer constuctor" if marionette_lt?(62.0, session)
|
||||
skip "IE doesn't support a DataTransfer constuctor" if ie?(session)
|
||||
end
|
||||
|
||||
it 'should HTML5 drag and drop an object' do
|
||||
pending "Firefox < 62 doesn't support a DataTransfer constuctor" if marionette_lt?(62.0, session)
|
||||
session.visit('/with_js')
|
||||
element = session.find('//div[@id="drag_html5"]')
|
||||
target = session.find('//div[@id="drop_html5"]')
|
||||
|
@ -314,7 +318,6 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
end
|
||||
|
||||
it 'should HTML5 drag and drop when scrolling needed' do
|
||||
pending "Firefox < 62 doesn't support a DataTransfer constuctor" if marionette_lt?(62.0, session)
|
||||
session.visit('/with_js')
|
||||
element = session.find('//div[@id="drag_html5_scroll"]')
|
||||
target = session.find('//div[@id="drop_html5_scroll"]')
|
||||
|
@ -323,7 +326,6 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
end
|
||||
|
||||
it 'should drag HTML5 default draggable elements' do
|
||||
pending "Firefox < 62 doesn't support a DataTransfer constuctor" if marionette_lt?(62.0, session)
|
||||
session.visit('/with_js')
|
||||
link = session.find_link('drag_link_html5')
|
||||
target = session.find(:id, 'drop_html5')
|
||||
|
@ -421,14 +423,13 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
end
|
||||
end
|
||||
|
||||
describe ":element selector" do
|
||||
it "can find html5 svg elements" do
|
||||
describe ':element selector' do
|
||||
it 'can find html5 svg elements' do
|
||||
session.visit('with_html5_svg')
|
||||
expect(session).to have_selector(:element, :svg)
|
||||
expect(session).to have_selector(:element, :rect, visible: true)
|
||||
expect(session).to have_selector(:element, :rect, visible: :hidden)
|
||||
expect(session).to have_selector(:element, :circle)
|
||||
expect(session).to have_selector(:element, :linearGradient, visible: false)
|
||||
expect(session).to have_selector(:element, :linearGradient, visible: :all)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue