capybara 3.20.2 → 3.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +14 -0
- data/README.md +4 -4
- data/lib/capybara.rb +11 -11
- data/lib/capybara/driver/node.rb +4 -0
- data/lib/capybara/helpers.rb +1 -1
- data/lib/capybara/minitest.rb +4 -4
- data/lib/capybara/node/actions.rb +36 -29
- data/lib/capybara/node/element.rb +123 -82
- data/lib/capybara/node/finders.rb +2 -7
- data/lib/capybara/selector/definition/css.rb +4 -1
- data/lib/capybara/selector/regexp_disassembler.rb +2 -2
- data/lib/capybara/selenium/extensions/html5_drag.rb +63 -0
- data/lib/capybara/selenium/node.rb +4 -0
- data/lib/capybara/selenium/nodes/chrome_node.rb +4 -0
- data/lib/capybara/selenium/nodes/firefox_node.rb +4 -13
- data/lib/capybara/selenium/nodes/ie_node.rb +14 -3
- data/lib/capybara/selenium/nodes/safari_node.rb +0 -13
- data/lib/capybara/spec/public/test.js +29 -3
- data/lib/capybara/spec/session/attach_file_spec.rb +13 -5
- data/lib/capybara/spec/session/has_css_spec.rb +4 -3
- data/lib/capybara/spec/session/node_spec.rb +85 -0
- data/lib/capybara/spec/spec_helper.rb +4 -0
- data/lib/capybara/version.rb +1 -1
- data/spec/selenium_spec_firefox.rb +2 -0
- data/spec/selenium_spec_ie.rb +13 -7
- data/spec/selenium_spec_safari.rb +2 -0
- data/spec/shared_selenium_session.rb +1 -51
- metadata +4 -4
@@ -73,6 +73,8 @@ Capybara::SpecHelper.run_specs TestSessions::Safari, SAFARI_DRIVER.to_s, capybar
|
|
73
73
|
when 'Capybara::Session selenium_safari #go_back should fetch a response from the driver from the previous page',
|
74
74
|
'Capybara::Session selenium_safari #go_forward should fetch a response from the driver from the previous page'
|
75
75
|
skip 'safaridriver loses the ability to find elements in the document after `go_back`'
|
76
|
+
when /drag_to.*HTML5/
|
77
|
+
pending "Safari doesn't support"
|
76
78
|
end
|
77
79
|
end
|
78
80
|
|
@@ -303,57 +303,6 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|
303
303
|
end
|
304
304
|
end
|
305
305
|
|
306
|
-
describe 'Element#drag_to' do
|
307
|
-
before do
|
308
|
-
skip "Firefox < 62 doesn't support a DataTransfer constuctor" if firefox_lt?(62.0, session)
|
309
|
-
skip "IE doesn't support a DataTransfer constuctor" if ie?(session)
|
310
|
-
skip "Safari doesn't support" if safari?(session)
|
311
|
-
end
|
312
|
-
|
313
|
-
it 'should HTML5 drag and drop an object' do
|
314
|
-
session.visit('/with_js')
|
315
|
-
element = session.find('//div[@id="drag_html5"]')
|
316
|
-
target = session.find('//div[@id="drop_html5"]')
|
317
|
-
element.drag_to(target)
|
318
|
-
expect(session).to have_xpath('//div[contains(., "HTML5 Dropped drag_html5")]')
|
319
|
-
end
|
320
|
-
|
321
|
-
it 'should set clientX/Y in dragover events' do
|
322
|
-
session.visit('/with_js')
|
323
|
-
element = session.find('//div[@id="drag_html5"]')
|
324
|
-
target = session.find('//div[@id="drop_html5"]')
|
325
|
-
element.drag_to(target)
|
326
|
-
session.all(:css, 'div.log').each { |el| puts el.text }
|
327
|
-
expect(session).to have_css('div.log', text: /DragOver with client position: [1-9]\d*,[1-9]\d*/, count: 2)
|
328
|
-
end
|
329
|
-
|
330
|
-
it 'should not HTML5 drag and drop on a non HTML5 drop element' do
|
331
|
-
session.visit('/with_js')
|
332
|
-
element = session.find('//div[@id="drag_html5"]')
|
333
|
-
target = session.find('//div[@id="drop_html5"]')
|
334
|
-
target.execute_script("$(this).removeClass('drop');")
|
335
|
-
element.drag_to(target)
|
336
|
-
sleep 1
|
337
|
-
expect(session).not_to have_xpath('//div[contains(., "HTML5 Dropped drag_html5")]')
|
338
|
-
end
|
339
|
-
|
340
|
-
it 'should HTML5 drag and drop when scrolling needed' do
|
341
|
-
session.visit('/with_js')
|
342
|
-
element = session.find('//div[@id="drag_html5_scroll"]')
|
343
|
-
target = session.find('//div[@id="drop_html5_scroll"]')
|
344
|
-
element.drag_to(target)
|
345
|
-
expect(session).to have_xpath('//div[contains(., "HTML5 Dropped drag_html5_scroll")]')
|
346
|
-
end
|
347
|
-
|
348
|
-
it 'should drag HTML5 default draggable elements' do
|
349
|
-
session.visit('/with_js')
|
350
|
-
link = session.find_link('drag_link_html5')
|
351
|
-
target = session.find(:id, 'drop_html5')
|
352
|
-
link.drag_to target
|
353
|
-
expect(session).to have_xpath('//div[contains(., "HTML5 Dropped")]')
|
354
|
-
end
|
355
|
-
end
|
356
|
-
|
357
306
|
describe 'Capybara#Node#attach_file' do
|
358
307
|
it 'can attach a directory' do
|
359
308
|
pending "Geckodriver doesn't support uploading a directory" if firefox?(session)
|
@@ -472,6 +421,7 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|
472
421
|
describe 'with react' do
|
473
422
|
context 'controlled components' do
|
474
423
|
it 'can set and clear a text field' do
|
424
|
+
skip "This test doesn't support older browsers" if ie?(session)
|
475
425
|
# session.visit 'https://reactjs.org/docs/forms.html'
|
476
426
|
# session.all(:css, 'h2#controlled-components ~ p a', text: 'Try it on CodePen')[0].click
|
477
427
|
# copied into local view
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Walpole
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- gem-public_cert.pem
|
13
|
-
date: 2019-05-
|
13
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -88,14 +88,14 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: '1.
|
91
|
+
version: '1.5'
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '1.
|
98
|
+
version: '1.5'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: xpath
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|