ae_page_objects 3.1.1 → 4.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ae_page_objects.rb +1 -5
- data/lib/ae_page_objects/element.rb +7 -0
- data/lib/ae_page_objects/elements/collection.rb +16 -11
- data/lib/ae_page_objects/node.rb +7 -0
- data/lib/ae_page_objects/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec99451835a9cb58fedf86d01f94171a62c47ec
|
4
|
+
data.tar.gz: cfd06fec6e4da6ea81d5cec3a94e91f21043bc5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92612a7cc134ceee95409dd8e7ef5141d23d14583f34c326d5b78b5b611201bfea2d0c22c50367f6bcc8f145c0b240940b283fd75de5ce0343d0dcb2cd94c1c7
|
7
|
+
data.tar.gz: 603d054ef32af331a10f16da82277a23ae402aa47f53e3cc1480535f1700795646490140a7e3994168d0a24bab13adfba9e703fd9258fca6c774c3223cbea4e6
|
data/lib/ae_page_objects.rb
CHANGED
@@ -99,11 +99,7 @@ module AePageObjects
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def default_max_wait_time
|
102
|
-
|
103
|
-
Capybara.default_max_wait_time
|
104
|
-
else
|
105
|
-
Capybara.default_wait_time
|
106
|
-
end
|
102
|
+
Capybara.default_max_wait_time
|
107
103
|
end
|
108
104
|
end
|
109
105
|
end
|
@@ -99,6 +99,13 @@ module AePageObjects
|
|
99
99
|
if locator.empty?
|
100
100
|
parent.node
|
101
101
|
else
|
102
|
+
default_options = { minimum: 0 }
|
103
|
+
if locator.last.is_a?(::Hash)
|
104
|
+
locator[-1] = default_options.merge(locator.last)
|
105
|
+
else
|
106
|
+
locator.push(default_options)
|
107
|
+
end
|
108
|
+
|
102
109
|
node = AePageObjects.wait_until { parent.node.first(*locator) }
|
103
110
|
node.allow_reload!
|
104
111
|
node
|
@@ -41,7 +41,7 @@ module AePageObjects
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def size
|
44
|
-
node.all(:xpath, item_xpath, options).size
|
44
|
+
node.all(:xpath, item_xpath, options.merge(wait: false)).size
|
45
45
|
end
|
46
46
|
|
47
47
|
def last
|
@@ -73,29 +73,34 @@ module AePageObjects
|
|
73
73
|
@item_xpath ||= begin
|
74
74
|
query_args = eval_locator(@item_locator).dup
|
75
75
|
|
76
|
-
|
76
|
+
default_options = {
|
77
|
+
session_options: Capybara.session_options
|
78
|
+
}
|
79
|
+
|
80
|
+
if query_args[1].is_a?(XPath::Expression)
|
77
81
|
#
|
78
82
|
# Use the { exact: true } setting for XPath selectors that use "XPath.is". For example, given the XPath
|
79
|
-
# XPath
|
83
|
+
# XPath.descendant(:div)[XPath.text.is('Example Text')]
|
80
84
|
# the resulting path will be
|
81
85
|
# .//div[./text() = 'Example Text']
|
82
86
|
# instead of
|
83
87
|
# .//div[contains(./text(), 'Example Text')]
|
84
88
|
# See https://github.com/jnicklas/capybara#exactness for more information.
|
85
89
|
#
|
86
|
-
default_options
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
default_options[:exact] = true
|
91
|
+
end
|
92
|
+
|
93
|
+
if query_args.last.is_a?(::Hash)
|
94
|
+
query_args[-1] = default_options.merge(query_args.last)
|
95
|
+
else
|
96
|
+
query_args.push(default_options)
|
92
97
|
end
|
93
98
|
|
94
|
-
query = Capybara::
|
99
|
+
query = Capybara::Queries::SelectorQuery.new(*query_args)
|
95
100
|
|
96
101
|
result = query.xpath
|
97
102
|
|
98
|
-
# if it's CSS, we need to run it through XPath as Capybara::
|
103
|
+
# if it's CSS, we need to run it through XPath as Capybara::Queries::SelectorQuery#xpath only
|
99
104
|
# works when the selector is xpath. Lame.
|
100
105
|
if query.selector.format == :css
|
101
106
|
result = XPath.css(query.xpath).to_xpath
|
data/lib/ae_page_objects/node.rb
CHANGED
@@ -17,6 +17,13 @@ module AePageObjects
|
|
17
17
|
|
18
18
|
is_loaded do
|
19
19
|
if locator = loaded_locator
|
20
|
+
default_options = { minimum: 0 }
|
21
|
+
if locator.last.is_a?(::Hash)
|
22
|
+
locator[-1] = default_options.merge(locator.last)
|
23
|
+
else
|
24
|
+
locator.push(default_options)
|
25
|
+
end
|
26
|
+
|
20
27
|
node.first(*eval_locator(locator)) != nil
|
21
28
|
else
|
22
29
|
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_page_objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donnie Tognazzini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
description: Capybara Page Objects pattern
|
28
28
|
email:
|
29
29
|
- engineering@appfolio.com
|
@@ -72,15 +72,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.2.5
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - "
|
78
|
+
- - ">"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
80
|
+
version: 1.3.1
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.2
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Capybara Page Objects pattern
|