page-object 2.2.4 → 2.2.5

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
  SHA1:
3
- metadata.gz: 74ccca073521956e4021906e6706540428334567
4
- data.tar.gz: 7eadfca835d4d213bca0e48662b853046ccb0c55
3
+ metadata.gz: 8e154a0c17c3a91e1bd0b15a404dd3605254fe6e
4
+ data.tar.gz: 0e9916491fc6a8db99fef697d289e69045a5d2fe
5
5
  SHA512:
6
- metadata.gz: 6161215bfc4fe2b236632ee4d02f6dea0cd10b52ac2ca51993cbec00df754ccdba724f3fefdc5d5cd32d7265c095603c7cf056141ff3c5c47671ecf04d065bc0
7
- data.tar.gz: '0434932392bb13c1814e3da9685d4d20bd7d750afa468218cb66c6ae915bc8ec0ce3d98403ae0c64adad162b2905a0a0cb0a08713caf9ad0986d79bdaa705cd0'
6
+ metadata.gz: 92a3431f085ef1e3692d64272ebadeed5a9cd07ab6af10750eca2df72c2091b82a3840d8560ee65fbc6d907214d8111083fd519e5a95d136c7ee117ecde198fa
7
+ data.tar.gz: 0af16e5f35e7235db98d8c0a5b8447e2d47e86e656255ff1c15efc391424b2e65035efd3ea788bfda017b8b82a3944e29faec175812e8e180b0886e8c1ec1b27
@@ -1 +1 @@
1
- ruby-2.4.0
1
+ ruby-2.4.1
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ Version 2.2.5 / 2018/11/21
2
+ * Enhancements
3
+ * populate_page_with will work with anything that can be converted to a Hash (Thanks Titus Fortner)
4
+ * Fixes
5
+ * Fixed present? when using with ActiveSupport (Thanks Justin Ko)
6
+ * Fixed issues with when_visible and when_not_visible (Thanks Justin Ko)
7
+
1
8
  Version 2.2.4 / 2017-9-23
2
9
  * Enhancements
3
10
  * Added the ability to get the values of a table column (Thanks sanvijay)
@@ -24,6 +24,13 @@ module PageObject
24
24
  not enabled?
25
25
  end
26
26
 
27
+ #
28
+ # return true if the element exists and is visible
29
+ #
30
+ def present?
31
+ element.present?
32
+ end
33
+
27
34
  #
28
35
  # specify plural form of element
29
36
  #
@@ -133,6 +140,7 @@ module PageObject
133
140
  element.wait_until(timeout: timeout, message: "Element not present in #{timeout} seconds", &:present?)
134
141
  self
135
142
  end
143
+ alias_method :when_visible, :when_present
136
144
 
137
145
  #
138
146
  # Waits until the element is not present
@@ -143,27 +151,7 @@ module PageObject
143
151
  def when_not_present(timeout=::PageObject.default_element_wait)
144
152
  element.wait_while(timeout: timeout, message: "Element still present in #{timeout} seconds", &:present?)
145
153
  end
146
-
147
- #
148
- # Waits until the element is visible
149
- #
150
- # @param [Integer] (defaults to: 5) seconds to wait before timing out
151
- #
152
- def when_visible(timeout=::PageObject.default_element_wait)
153
- when_present(timeout)
154
- element.wait_until(timeout: timeout, message: "Element not visible in #{timeout} seconds", &:visible?)
155
- self
156
- end
157
-
158
- #
159
- # Waits until the element is not visible
160
- #
161
- # @param [Integer] (defaults to: 5) seconds to wait before timing out
162
- #
163
- def when_not_visible(timeout=::PageObject.default_element_wait)
164
- when_present(timeout)
165
- element.wait_while(timeout: timeout, message: "Element still visible after #{timeout} seconds", &:visible?)
166
- end
154
+ alias_method :when_not_visible, :when_not_present
167
155
 
168
156
  #
169
157
  # Waits until the block returns true
@@ -30,8 +30,8 @@ module PageObject
30
30
  # false for a Checkbox or RadioButton.
31
31
  #
32
32
  def populate_page_with(data)
33
- data.each do |key, value|
34
- populate_section(key, value) if value.is_a?(Hash)
33
+ data.to_h.each do |key, value|
34
+ populate_section(key, value) if value.respond_to?(:to_h)
35
35
  populate_value(self, key, value)
36
36
  end
37
37
  end
@@ -40,7 +40,7 @@ module PageObject
40
40
 
41
41
  def populate_section(section, data)
42
42
  return unless self.respond_to? section
43
- data.each do |key, value|
43
+ data.to_h.each do |key, value|
44
44
  populate_value(self.send(section), key, value)
45
45
  end
46
46
  end
@@ -1,4 +1,4 @@
1
1
  module PageObject
2
2
  # @private
3
- VERSION = "2.2.4"
3
+ VERSION = "2.2.5"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page-object
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Morgan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-23 00:00:00.000000000 Z
12
+ date: 2018-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  version: '0'
245
245
  requirements: []
246
246
  rubyforge_project:
247
- rubygems_version: 2.6.13
247
+ rubygems_version: 2.6.14
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Page Object DSL for browser testing