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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0025f2cd90d1613fc5699f80dfe27de1e9117d3d1045d200199cadf7073b7c9
4
- data.tar.gz: 6dae02265d6ab3c436fe415c09f040276d290d0c5c63e94b0b30c3dc841d4196
3
+ metadata.gz: dee3d840775da65eaa16425c78f811a06f91979fbccbbb43ac9f90591af181a8
4
+ data.tar.gz: 517c36c4ac90c5762c776a65e3c1bb66f50a83f3ad033671690ec23dbf268bea
5
5
  SHA512:
6
- metadata.gz: f9f846b4daa76ef8d3f59c96bedd65c79bc474c474744c31d5903ad355b89a5e19463793b04174633a10f580dfecf2839ec69276f18e695ea43eda83887697fa
7
- data.tar.gz: ed76dbaa70c21b1a1cc62f4b0e7976064c664b4181aeb39ec0614c95dc9e097c79a4195d8f2ea015c177eddf1cee63ba8885a4203bc2a3a9a55dfead7d683f90
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
- if locator.empty?
111
- parent.node
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 = { minimum: 0 }
114
- if locator.last.is_a?(::Hash)
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
- node.allow_reload!
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
@@ -1,3 +1,3 @@
1
1
  module AePageObjects
2
- VERSION = '4.3.1.tim3'.freeze
2
+ VERSION = '4.3.1.tim4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_page_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.1.tim3
4
+ version: 4.3.1.tim4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio Engineering