ae_page_objects 4.3.1.tim3 → 4.3.1.tim4
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/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: dee3d840775da65eaa16425c78f811a06f91979fbccbbb43ac9f90591af181a8
|
4
|
+
data.tar.gz: 517c36c4ac90c5762c776a65e3c1bb66f50a83f3ad033671690ec23dbf268bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c536cc96e5bc40d1b9c3566e7f5615e8708a29a890e0a0f4da1f221222f2622d1882a2bf53a12e0f940932c8c8de7098f373756aefa5e68d893534d23ddf747
|
7
|
+
data.tar.gz: faf31a82c8416aa904eebafdf6dd4c5e5868a6b5b227e7e6df56300389fea5aa08ea87a021a7e155d71faa583163a2a60e233e47267dd85884e6850faa323e29
|
@@ -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
|