ae_page_objects 4.3.1.tim3 → 5.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/element.rb +19 -10
- data/lib/ae_page_objects/element_proxy.rb +5 -5
- data/lib/ae_page_objects/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 050326bd45948e6541587873da40715708f854333d9965816e0d7d78d54d33bb
|
4
|
+
data.tar.gz: baaa65ec6da2ef99f462d2259e8add8920654897e078dabe2b0b237c7f57b390
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 370ec5c9073399673f4cd498b35440319c8c81677d4c198a835a6ed56d8859da8333129315b1306119e9e6ac6559a2fc412c0e51c81f7fcfe0414ef907779305
|
7
|
+
data.tar.gz: 694053ed1cf77a4258c8c68a4652f02f6ec5a52b778e77f79d78d881610416e693b5cc19c4ce427e01c60a7b7bc92d38ec4f4f4656331221bd158028cef10ecb
|
@@ -89,6 +89,11 @@ module AePageObjects
|
|
89
89
|
def configure(options)
|
90
90
|
@locator = options.delete(:locator)
|
91
91
|
@name = options.delete(:name)
|
92
|
+
if options.key?(:wait)
|
93
|
+
@wait = options.delete(:wait)
|
94
|
+
else
|
95
|
+
@wait = true
|
96
|
+
end
|
92
97
|
|
93
98
|
@name = @name.to_s if @name
|
94
99
|
end
|
@@ -107,20 +112,24 @@ module AePageObjects
|
|
107
112
|
|
108
113
|
def scoped_node
|
109
114
|
locator = eval_locator(@locator)
|
110
|
-
|
111
|
-
|
115
|
+
|
116
|
+
return parent.node if locator.empty?
|
117
|
+
|
118
|
+
default_options = { minimum: 0 }
|
119
|
+
if locator.last.is_a?(::Hash)
|
120
|
+
locator[-1] = default_options.merge(locator.last)
|
112
121
|
else
|
113
|
-
default_options
|
114
|
-
|
115
|
-
locator[-1] = default_options.merge(locator.last)
|
116
|
-
else
|
117
|
-
locator.push(default_options)
|
118
|
-
end
|
122
|
+
locator.push(default_options)
|
123
|
+
end
|
119
124
|
|
125
|
+
if @wait
|
120
126
|
node = AePageObjects.wait_until { parent.node.first(*locator) }
|
121
|
-
|
122
|
-
node
|
127
|
+
else
|
128
|
+
node = parent.node.first(*locator)
|
129
|
+
raise LoadingElementFailed, 'Element Not Found' unless node
|
123
130
|
end
|
131
|
+
node.allow_reload!
|
132
|
+
node
|
124
133
|
rescue AePageObjects::WaitTimeoutError => e
|
125
134
|
raise LoadingElementFailed, e.message
|
126
135
|
end
|
@@ -15,21 +15,21 @@ module AePageObjects
|
|
15
15
|
@loaded_element = nil
|
16
16
|
end
|
17
17
|
|
18
|
-
def visible?
|
18
|
+
def visible?
|
19
19
|
reload_element
|
20
20
|
@loaded_element&.visible?
|
21
21
|
end
|
22
22
|
|
23
|
-
def hidden?
|
23
|
+
def hidden?
|
24
24
|
!visible?
|
25
25
|
end
|
26
26
|
|
27
|
-
def present?
|
27
|
+
def present?
|
28
28
|
reload_element
|
29
29
|
!@loaded_element.nil?
|
30
30
|
end
|
31
31
|
|
32
|
-
def absent?
|
32
|
+
def absent?
|
33
33
|
!present?
|
34
34
|
end
|
35
35
|
|
@@ -118,7 +118,7 @@ module AePageObjects
|
|
118
118
|
|
119
119
|
options_or_locator = args.pop
|
120
120
|
options = if options_or_locator.is_a?(Hash)
|
121
|
-
options_or_locator.
|
121
|
+
options_or_locator.merge(wait: wait)
|
122
122
|
else
|
123
123
|
{ locator: options_or_locator, wait: wait }
|
124
124
|
end
|
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: 5.0.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 1.3.1
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.1.
|
82
|
+
rubygems_version: 3.1.2
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Capybara Page Objects pattern
|