capybara 3.35.0 → 3.35.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +8 -0
- data/lib/capybara/registrations/drivers.rb +2 -2
- data/lib/capybara/selector/definition/button.rb +1 -1
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +9 -0
- data/lib/capybara/spec/views/form.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2913f83c980b16f28c90df040eea7a31502facb4d78a0dc9cd54a37e2faee9e7
|
4
|
+
data.tar.gz: 105f72f39f609d3865a7414d8103ae0fd12f23b3f437d867994d395487eeaf55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec65b7e51aaf5df4fc9a3370deafd98ea35d20bc1aecd4d3349f6a64f7406f647bbdf632601c6a27db4846a6f68a32cf3c95e6d5d7a038c3fd2c48724c3a3e23
|
7
|
+
data.tar.gz: 8a14863dae239561f674899ee7209ab54d02b1c7b3890aaf2d8cbeb8d3a349d341c7bb6a021aa85702aa7f885aa5e2602f1c64cefc488a4d2ea9f9dd86e7710f
|
data/History.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# Version 3.35.1
|
2
|
+
Release date: 2020-01-26
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
* Default chrome driver registrations use chrome - Issue #2442 [Yuriy Alekseyev]
|
7
|
+
* 'Capybara.test_id' usage with the :button selector - Issue #2443
|
8
|
+
|
1
9
|
# Version 3.35.0
|
2
10
|
Release date: 2020-01-25
|
3
11
|
|
@@ -25,7 +25,7 @@ Capybara.register_driver :selenium_chrome do |app|
|
|
25
25
|
opts.add_argument('--disable-site-isolation-trials')
|
26
26
|
end
|
27
27
|
|
28
|
-
Capybara::Selenium::Driver.new(app, **Hash[:browser => :
|
28
|
+
Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options])
|
29
29
|
end
|
30
30
|
|
31
31
|
Capybara.register_driver :selenium_chrome_headless do |app|
|
@@ -38,5 +38,5 @@ Capybara.register_driver :selenium_chrome_headless do |app|
|
|
38
38
|
opts.add_argument('--disable-site-isolation-trials')
|
39
39
|
end
|
40
40
|
|
41
|
-
Capybara::Selenium::Driver.new(app, **Hash[:browser => :
|
41
|
+
Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options])
|
42
42
|
end
|
@@ -57,7 +57,7 @@ Capybara.add_selector(:button, locator_type: [String, Symbol]) do
|
|
57
57
|
XPath.attr(:title).is(locator),
|
58
58
|
(XPath.attr(:id) == XPath.anywhere(:label)[XPath.string.n.is(locator)].attr(:for)),
|
59
59
|
(XPath.attr(:'aria-label').is(locator) if config.enable_aria_label),
|
60
|
-
(XPath.attr(test_id) == locator if config.test_id)
|
60
|
+
(XPath.attr(config.test_id) == locator if config.test_id)
|
61
61
|
].compact.inject(&:|)
|
62
62
|
end
|
63
63
|
end
|
@@ -38,6 +38,15 @@ Capybara::SpecHelper.spec '#click_link_or_button' do
|
|
38
38
|
expect(extract_results(@session)['first_name']).to eq('John')
|
39
39
|
end
|
40
40
|
|
41
|
+
context 'with test_id' do
|
42
|
+
it 'should click on a button' do
|
43
|
+
Capybara.test_id = 'data-test-id'
|
44
|
+
@session.visit('/form')
|
45
|
+
@session.click_link_or_button('test_id_button')
|
46
|
+
expect(extract_results(@session)['first_name']).to eq('John')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
41
50
|
context 'with :exact option' do
|
42
51
|
context 'when `false`' do
|
43
52
|
it 'clicks on approximately matching link' do
|
@@ -449,7 +449,7 @@ New line after and before textarea tag
|
|
449
449
|
|
450
450
|
<p>
|
451
451
|
<input type="button" aria-label="Aria button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
|
452
|
-
<input type="submit" name="form[awesome]" id="awe123" title="What an Awesome Button" value="awesome"/>
|
452
|
+
<input type="submit" name="form[awesome]" id="awe123" data-test-id="test_id_button" title="What an Awesome Button" value="awesome"/>
|
453
453
|
<input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
|
454
454
|
<input type="image" name="form[okay]" id="okay556" title="Okay 556 Image" value="okay" alt="oh hai thar"/>
|
455
455
|
<button type="submit" id="click_me_123" title="Click Title button" value="click_me">Click me!</button>
|
data/lib/capybara/version.rb
CHANGED