cornucopia 0.1.52 → 0.1.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cornucopia/capybara/finder_extensions.rb +4 -4
- data/lib/cornucopia/capybara/matcher_extensions.rb +5 -5
- data/lib/cornucopia/site_prism/element_extensions.rb +2 -2
- data/lib/cornucopia/site_prism/section_extensions.rb +2 -2
- data/lib/cornucopia/version.rb +1 -1
- data/spec/lib/capybara/finder_extensions_spec.rb +6 -6
- data/spec/lib/capybara/matcher_extensions_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a3dc40d384cccf40c5266473b60fe5dac6905ba
|
4
|
+
data.tar.gz: ff9bcbc57aba3e739ad91f796171339539803f2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8999360f8d8078120a7692979229dcc5d23441d7b174c0bf153f24648a04f10e79272436213a1227f72edeeb1bc11224d13504cc6699e987333d5d482bd5a806
|
7
|
+
data.tar.gz: 4c9843bca5facaf8e664046aa8c1e0bb1dda3fd25bb96e7ec838f860f19662134f17554d26b0cd7aa819d71cb4cd4f81e6ccfee6b3193e77b68cc285b9dab52b
|
@@ -11,8 +11,8 @@ module Cornucopia
|
|
11
11
|
extend ActiveSupport::Concern
|
12
12
|
|
13
13
|
included do
|
14
|
-
alias_method :
|
15
|
-
alias_method :
|
14
|
+
alias_method :__cornucopia_capybara_orig_find, :find
|
15
|
+
alias_method :__cornucopia_capybara_orig_all, :all
|
16
16
|
|
17
17
|
define_method :find do |*args, &block|
|
18
18
|
__cornucopia_finder_function(:find, *args, &block)
|
@@ -31,12 +31,12 @@ module Cornucopia
|
|
31
31
|
|
32
32
|
begin
|
33
33
|
retry_count += 1
|
34
|
-
result = send("
|
34
|
+
result = send("__cornucopia_capybara_orig_#{finder_function}", *args, &block)
|
35
35
|
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
36
36
|
retry if __cornucopia__retry_finder(retry_count, support_options)
|
37
37
|
|
38
38
|
result = __cornucopia__analyze_finder(finder_function, support_options, *args, &block)
|
39
|
-
rescue
|
39
|
+
rescue StandardError
|
40
40
|
result = __cornucopia__analyze_finder(finder_function, support_options, *args, &block)
|
41
41
|
end
|
42
42
|
|
@@ -11,10 +11,10 @@ module Cornucopia
|
|
11
11
|
extend ActiveSupport::Concern
|
12
12
|
|
13
13
|
included do
|
14
|
-
alias_method :
|
15
|
-
alias_method :
|
16
|
-
alias_method :
|
17
|
-
alias_method :
|
14
|
+
alias_method :__cornucopia_capybara_orig_assert_selector, :assert_selector
|
15
|
+
alias_method :__cornucopia_capybara_orig_assert_no_selector, :assert_no_selector
|
16
|
+
alias_method :__cornucopia_capybara_orig_has_selector?, :has_selector?
|
17
|
+
alias_method :__cornucopia_capybara_orig_has_no_selector?, :has_no_selector?
|
18
18
|
|
19
19
|
define_method :assert_selector do |*args|
|
20
20
|
__cornucopia_assert_selector_function(:assert_selector, *args)
|
@@ -59,7 +59,7 @@ module Cornucopia
|
|
59
59
|
|
60
60
|
begin
|
61
61
|
retry_count += 1
|
62
|
-
result = send("
|
62
|
+
result = send("__cornucopia_capybara_orig_#{assert_selector_function}", *args)
|
63
63
|
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
64
64
|
retry if __cornucopia__retry_selector(retry_count, support_options)
|
65
65
|
|
@@ -9,13 +9,13 @@ module Cornucopia
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
::Capybara::Session::DSL_METHODS.each do |method|
|
12
|
-
alias_method "
|
12
|
+
alias_method "__cornucopia_site_prism_orig_#{method}".to_sym, method
|
13
13
|
|
14
14
|
define_method method do |*args, &block|
|
15
15
|
if @__corunucopia_base_node
|
16
16
|
@__corunucopia_base_node.send method, *args, &block
|
17
17
|
else
|
18
|
-
send "
|
18
|
+
send "__cornucopia_site_prism_orig_#{method}", *args, &block
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -9,10 +9,10 @@ module Cornucopia
|
|
9
9
|
|
10
10
|
included do |base|
|
11
11
|
base.class_exec do
|
12
|
-
alias :
|
12
|
+
alias :__cornucopia_site_prism_orig_initialize :initialize
|
13
13
|
|
14
14
|
def initialize(*args)
|
15
|
-
|
15
|
+
__cornucopia_site_prism_orig_initialize(*args)
|
16
16
|
|
17
17
|
self.owner_node = args[0].owner_node
|
18
18
|
end
|
data/lib/cornucopia/version.rb
CHANGED
@@ -47,7 +47,7 @@ describe Cornucopia::Capybara::FinderExtensions, type: :feature do
|
|
47
47
|
num_calls = 0
|
48
48
|
|
49
49
|
allow(contents_frame.page.document).
|
50
|
-
to receive(:
|
50
|
+
to receive(:__cornucopia_capybara_orig_all) do |*args|
|
51
51
|
num_calls += 1
|
52
52
|
|
53
53
|
if time_count > 0
|
@@ -62,7 +62,7 @@ describe Cornucopia::Capybara::FinderExtensions, type: :feature do
|
|
62
62
|
second_found = contents_frame.all("a")
|
63
63
|
|
64
64
|
allow(contents_frame.page.document).
|
65
|
-
to receive(:
|
65
|
+
to receive(:__cornucopia_capybara_orig_all).
|
66
66
|
and_call_original
|
67
67
|
|
68
68
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
@@ -89,14 +89,14 @@ describe Cornucopia::Capybara::FinderExtensions, type: :feature do
|
|
89
89
|
and_return(found_elements)
|
90
90
|
|
91
91
|
allow(contents_frame.page.document).
|
92
|
-
to receive(:
|
92
|
+
to receive(:__cornucopia_capybara_orig_all) do |*args|
|
93
93
|
raise Selenium::WebDriver::Error::StaleElementReferenceError.new
|
94
94
|
end
|
95
95
|
|
96
96
|
second_found = contents_frame.all("a")
|
97
97
|
|
98
98
|
allow(contents_frame.page.document).
|
99
|
-
to receive(:
|
99
|
+
to receive(:__cornucopia_capybara_orig_all).
|
100
100
|
and_call_original
|
101
101
|
|
102
102
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
@@ -121,14 +121,14 @@ describe Cornucopia::Capybara::FinderExtensions, type: :feature do
|
|
121
121
|
and_return(found_elements)
|
122
122
|
|
123
123
|
allow(contents_frame.page.document).
|
124
|
-
to receive(:
|
124
|
+
to receive(:__cornucopia_capybara_orig_find) do |*args|
|
125
125
|
raise "This is an error"
|
126
126
|
end
|
127
127
|
|
128
128
|
second_found = contents_frame.find(".report-block")
|
129
129
|
|
130
130
|
allow(contents_frame.page.document).
|
131
|
-
to receive(:
|
131
|
+
to receive(:__cornucopia_capybara_orig_find).
|
132
132
|
and_call_original
|
133
133
|
|
134
134
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
@@ -47,7 +47,7 @@ describe Cornucopia::Capybara::MatcherExtensions, type: :feature do
|
|
47
47
|
num_calls = 0
|
48
48
|
|
49
49
|
allow(contents_frame.page.document).
|
50
|
-
to receive(:
|
50
|
+
to receive(:__cornucopia_capybara_orig_assert_selector) do |*args|
|
51
51
|
num_calls += 1
|
52
52
|
|
53
53
|
if time_count > 0
|
@@ -62,7 +62,7 @@ describe Cornucopia::Capybara::MatcherExtensions, type: :feature do
|
|
62
62
|
second_found = contents_frame.assert_selector("a")
|
63
63
|
|
64
64
|
allow(contents_frame.page.document).
|
65
|
-
to receive(:
|
65
|
+
to receive(:__cornucopia_capybara_orig_assert_selector).
|
66
66
|
and_call_original
|
67
67
|
|
68
68
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
@@ -89,14 +89,14 @@ describe Cornucopia::Capybara::MatcherExtensions, type: :feature do
|
|
89
89
|
and_return(found_elements)
|
90
90
|
|
91
91
|
allow(contents_frame.page.document).
|
92
|
-
to receive(:
|
92
|
+
to receive(:__cornucopia_capybara_orig_assert_selector) do |*args|
|
93
93
|
raise Selenium::WebDriver::Error::StaleElementReferenceError.new
|
94
94
|
end
|
95
95
|
|
96
96
|
second_found = contents_frame.assert_selector("a")
|
97
97
|
|
98
98
|
allow(contents_frame.page.document).
|
99
|
-
to receive(:
|
99
|
+
to receive(:__cornucopia_capybara_orig_assert_selector).
|
100
100
|
and_call_original
|
101
101
|
|
102
102
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
@@ -121,14 +121,14 @@ describe Cornucopia::Capybara::MatcherExtensions, type: :feature do
|
|
121
121
|
and_return(found_elements)
|
122
122
|
|
123
123
|
allow(contents_frame.page.document).
|
124
|
-
to receive(:
|
124
|
+
to receive(:__cornucopia_capybara_orig_assert_no_selector) do |*args|
|
125
125
|
raise "This is an error"
|
126
126
|
end
|
127
127
|
|
128
128
|
second_found = contents_frame.assert_no_selector(".report-block")
|
129
129
|
|
130
130
|
allow(contents_frame.page.document).
|
131
|
-
to receive(:
|
131
|
+
to receive(:__cornucopia_capybara_orig_assert_no_selector).
|
132
132
|
and_call_original
|
133
133
|
|
134
134
|
# I realize that this is almost like testing that the stub worked, which we don't need to test.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cornucopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RealNobody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|