capybara 2.10.0 → 2.10.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/result.rb +5 -0
- data/lib/capybara/selector.rb +2 -0
- data/lib/capybara/selenium/driver.rb +2 -0
- data/lib/capybara/session.rb +1 -1
- data/lib/capybara/spec/public/test.js +1 -1
- data/lib/capybara/spec/session/accept_alert_spec.rb +15 -1
- data/lib/capybara/version.rb +1 -1
- data/spec/result_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07946b3e00d76327b735257b253d81a77f0bfd00
|
4
|
+
data.tar.gz: d374024318381ec84383a452871be665f7645168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d5d700c0b6473d31e6196ff3def9f259a72038c4bfc4082e2b2351bda87ecbe20d25843d59eaba8f6b50de19f0314e708d9e340149cf0385eb2e8c0874f2bfc
|
7
|
+
data.tar.gz: 5ce06798a097f56b478b3d1d9345aa50bc21977db980832747dba6429edd9506ea20aecbaebd320aae9e17675c46201f168bbdbc34ddf9cc3923e3458eef6184
|
data/History.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
#2.10.1
|
2
|
+
Release date: 2016-10-08
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
* App errors are now correctly raised with the explanatory cause in JRuby [Thomas Walpole]
|
6
|
+
* Capybara::Result optimization disabled in JRuby due to issue with lazy enumerator evaluation [Thomas Walpole]
|
7
|
+
See: https://github.com/jruby/jruby/issues/4212
|
8
|
+
|
1
9
|
#2.10.0
|
2
10
|
Release date: 2016-10-05
|
3
11
|
|
data/lib/capybara/result.rb
CHANGED
@@ -28,6 +28,11 @@ module Capybara
|
|
28
28
|
@result_cache = []
|
29
29
|
@results_enum = lazy_select_elements { |node| query.matches_filters?(node) }
|
30
30
|
@query = query
|
31
|
+
# JRuby has an issue with eagerly finding next in lazy enumerators which
|
32
|
+
# causes a concurrency issue with network requests here
|
33
|
+
# https://github.com/jruby/jruby/issues/4212
|
34
|
+
# Just force all the results to be evaluated
|
35
|
+
full_results if RUBY_PLATFORM == 'java'
|
31
36
|
end
|
32
37
|
|
33
38
|
def_delegators :full_results, :size, :length, :last, :values_at, :inspect, :sample
|
data/lib/capybara/selector.rb
CHANGED
@@ -345,6 +345,7 @@ Capybara.add_selector(:select) do
|
|
345
345
|
end
|
346
346
|
options.sort == actual.sort
|
347
347
|
end
|
348
|
+
|
348
349
|
filter(:with_options) do |node, options|
|
349
350
|
finder_settings = { minimum: 0 }
|
350
351
|
if !node.visible?
|
@@ -352,6 +353,7 @@ Capybara.add_selector(:select) do
|
|
352
353
|
end
|
353
354
|
options.all? { |option| node.first(:option, option, finder_settings) }
|
354
355
|
end
|
356
|
+
|
355
357
|
filter(:selected) do |node, selected|
|
356
358
|
actual = node.all(:xpath, './/option', visible: false).select { |option| option.selected? }.map { |option| option.text(:all) }
|
357
359
|
[selected].flatten.sort == actual.sort
|
@@ -2,6 +2,7 @@
|
|
2
2
|
require "uri"
|
3
3
|
|
4
4
|
class Capybara::Selenium::Driver < Capybara::Driver::Base
|
5
|
+
|
5
6
|
DEFAULT_OPTIONS = {
|
6
7
|
:browser => :firefox
|
7
8
|
}
|
@@ -40,6 +41,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
44
|
+
|
43
45
|
@app = app
|
44
46
|
@browser = nil
|
45
47
|
@exit_status = nil
|
data/lib/capybara/session.rb
CHANGED
@@ -125,7 +125,7 @@ module Capybara
|
|
125
125
|
begin
|
126
126
|
raise CapybaraError, "Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true"
|
127
127
|
rescue CapybaraError
|
128
|
-
raise @server.error
|
128
|
+
raise @server.error.class, @server.error.message, @server.error.backtrace
|
129
129
|
end
|
130
130
|
end
|
131
131
|
ensure
|
@@ -18,6 +18,20 @@ Capybara::SpecHelper.spec '#accept_alert', requires: [:modals] do
|
|
18
18
|
expect(@session).to have_xpath("//a[@id='open-alert' and @opened='true']")
|
19
19
|
end
|
20
20
|
|
21
|
+
it 'should accept the alert if text contains "special" Regex characters' do
|
22
|
+
@session.accept_alert 'opened [*Yay?*]' do
|
23
|
+
@session.click_link('Open alert')
|
24
|
+
end
|
25
|
+
expect(@session).to have_xpath("//a[@id='open-alert' and @opened='true']")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should accept the alert if the text matches a regexp" do
|
29
|
+
@session.accept_alert /op.{2}ed/ do
|
30
|
+
@session.click_link('Open alert')
|
31
|
+
end
|
32
|
+
expect(@session).to have_xpath("//a[@id='open-alert' and @opened='true']")
|
33
|
+
end
|
34
|
+
|
21
35
|
it "should not accept the alert if the text doesnt match" do
|
22
36
|
expect do
|
23
37
|
@session.accept_alert 'Incorrect Text' do
|
@@ -30,7 +44,7 @@ Capybara::SpecHelper.spec '#accept_alert', requires: [:modals] do
|
|
30
44
|
message = @session.accept_alert do
|
31
45
|
@session.click_link('Open alert')
|
32
46
|
end
|
33
|
-
expect(message).to eq('Alert opened')
|
47
|
+
expect(message).to eq('Alert opened [*Yay?*]')
|
34
48
|
end
|
35
49
|
|
36
50
|
context "with an asynchronous alert" do
|
data/lib/capybara/version.rb
CHANGED
data/spec/result_spec.rb
CHANGED
@@ -73,6 +73,7 @@ RSpec.describe Capybara::Result do
|
|
73
73
|
|
74
74
|
#Not a great test but it indirectly tests what is needed
|
75
75
|
it "should evaluate filters lazily" do
|
76
|
+
skip 'JRuby has an issue with lazy enumerator next evaluation' if RUBY_PLATFORM == 'java'
|
76
77
|
#Not processed until accessed
|
77
78
|
expect(result.instance_variable_get('@result_cache').size).to be 0
|
78
79
|
|
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: 2.10.
|
4
|
+
version: 2.10.1
|
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: 2016-10-
|
13
|
+
date: 2016-10-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -442,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
442
442
|
version: '0'
|
443
443
|
requirements: []
|
444
444
|
rubyforge_project:
|
445
|
-
rubygems_version: 2.
|
445
|
+
rubygems_version: 2.5.1
|
446
446
|
signing_key:
|
447
447
|
specification_version: 4
|
448
448
|
summary: Capybara aims to simplify the process of integration testing Rack applications,
|