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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0025f2cd90d1613fc5699f80dfe27de1e9117d3d1045d200199cadf7073b7c9
4
- data.tar.gz: 6dae02265d6ab3c436fe415c09f040276d290d0c5c63e94b0b30c3dc841d4196
3
+ metadata.gz: 050326bd45948e6541587873da40715708f854333d9965816e0d7d78d54d33bb
4
+ data.tar.gz: baaa65ec6da2ef99f462d2259e8add8920654897e078dabe2b0b237c7f57b390
5
5
  SHA512:
6
- metadata.gz: f9f846b4daa76ef8d3f59c96bedd65c79bc474c474744c31d5903ad355b89a5e19463793b04174633a10f580dfecf2839ec69276f18e695ea43eda83887697fa
7
- data.tar.gz: ed76dbaa70c21b1a1cc62f4b0e7976064c664b4181aeb39ec0614c95dc9e097c79a4195d8f2ea015c177eddf1cee63ba8885a4203bc2a3a9a55dfead7d683f90
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
- 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
@@ -15,21 +15,21 @@ module AePageObjects
15
15
  @loaded_element = nil
16
16
  end
17
17
 
18
- def visible?(options = {})
18
+ def visible?
19
19
  reload_element
20
20
  @loaded_element&.visible?
21
21
  end
22
22
 
23
- def hidden?(options = {})
23
+ def hidden?
24
24
  !visible?
25
25
  end
26
26
 
27
- def present?(options = {})
27
+ def present?
28
28
  reload_element
29
29
  !@loaded_element.nil?
30
30
  end
31
31
 
32
- def absent?(options = {})
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.dup.merge(wait: wait)
121
+ options_or_locator.merge(wait: wait)
122
122
  else
123
123
  { locator: options_or_locator, wait: wait }
124
124
  end
@@ -1,3 +1,3 @@
1
1
  module AePageObjects
2
- VERSION = '4.3.1.tim3'.freeze
2
+ VERSION = '5.0.0.pre1'.freeze
3
3
  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.3.1.tim3
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-03-18 00:00:00.000000000 Z
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.4
82
+ rubygems_version: 3.1.2
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Capybara Page Objects pattern