ae_page_objects 4.1.0.pre1 → 4.3.1.tim2

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
- SHA1:
3
- metadata.gz: ecd6bbce068b3386caeb99e57ce81897cc4e27f2
4
- data.tar.gz: 3a1b79f9613d77a54ac07b21fa0ed564d29b9b20
2
+ SHA256:
3
+ metadata.gz: 58d8bc18133617527821d0a7c7be47c0528978567b66277aa9a1ff0b0cbdcaa8
4
+ data.tar.gz: 0a622745a70d3a4d9de923ee27295377096203a170bddcf8517acaee028ba19f
5
5
  SHA512:
6
- metadata.gz: 7879a5acb6e944f3187232aebe1d6d351cb6b1ac24d70731979ebc699b5d3be7a73e31454595f14df69d3d28866be873a181b28fe5be0891b27a66c1eb803a99
7
- data.tar.gz: 8d66e7e832f1af7184023096451a96e24903fcfafacf670d4df4d0c4bc717cf2d915056cda5913d36df3a15ce8af3ad9750eb86a6224981e3e041a7f68383857
6
+ metadata.gz: 9a512bbe4c7fa4bfb6d4073d6fce4a0f40103d1825a6d6a54139e32c0717d2708dfe255ae0124a6cf98869490d74d5eef3fd009bb425234c62a7e29200672f7b
7
+ data.tar.gz: db42b665475663853467ca009fdac381918bc569fa029aded63237ffbd21eccbf681c0e305399787e648d1b4bc5c1847a2c7f66d6c58da15a2f3bdd29b620529
@@ -16,31 +16,21 @@ module AePageObjects
16
16
  end
17
17
 
18
18
  def visible?(options = {})
19
- wait_until_visible(options[:wait])
20
- true
21
- rescue ElementNotVisible
22
- false
19
+ reload_element
20
+ @loaded_element&.visible?
23
21
  end
24
22
 
25
23
  def hidden?(options = {})
26
- wait_until_hidden(options[:wait])
27
- true
28
- rescue ElementNotHidden
29
- false
24
+ !visible?
30
25
  end
31
26
 
32
27
  def present?(options = {})
33
- wait_until_present(options[:wait])
34
- true
35
- rescue ElementNotPresent
36
- false
28
+ reload_element
29
+ !@loaded_element.nil?
37
30
  end
38
31
 
39
32
  def absent?(options = {})
40
- wait_until_absent(options[:wait])
41
- true
42
- rescue ElementNotAbsent
43
- false
33
+ !present?
44
34
  end
45
35
 
46
36
  def presence
@@ -41,7 +41,19 @@ module AePageObjects
41
41
  end
42
42
 
43
43
  def size
44
- node.all(:xpath, item_xpath, options.merge(wait: false)).size
44
+ #
45
+ # In some cases when #size is called while the DOM is updating, Capybara
46
+ # will catch (and swallow) underlying exceptions such as
47
+ # `Selenium::WebDriver::Error::StaleElementReferenceError`.
48
+ # When this happens it will wait up to the max wait time, which can cause
49
+ # issues for `AePageObjects.wait_until` blocks.
50
+ #
51
+ # To prevent this issue the #all and #size calls are made with the Capybara
52
+ # wait time set to 0.
53
+ #
54
+ Capybara.using_wait_time(0) do
55
+ node.all(:xpath, item_xpath, options).size
56
+ end
45
57
  end
46
58
 
47
59
  def last
@@ -133,12 +133,12 @@ module AePageObjects
133
133
  private
134
134
 
135
135
  def recognizer
136
- @recognizer ||= case ::Rails.version
137
- when /\A3\.[01]/
136
+ @recognizer ||= case ::Rails.gem_version
137
+ when Gem::Requirement.new('>= 3.0', '< 3.2')
138
138
  Recognizer::Rails3.new
139
- when /\A3\.2/
139
+ when Gem::Requirement.new('~> 3.2')
140
140
  Recognizer::Rails32.new
141
- when /\A(4\.[012]|5\.0)/
141
+ when Gem::Requirement.new('>= 4.0', '< 7.0')
142
142
  Recognizer::Rails4Plus.new
143
143
  else
144
144
  warn "[WARNING]: AePageObjects is not tested against Rails #{::Rails.version} and may behave in an undefined manner."
@@ -1,3 +1,3 @@
1
1
  module AePageObjects
2
- VERSION = '4.1.0.pre1'.freeze
2
+ VERSION = '4.3.1.tim2'.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.1.0.pre1
4
+ version: 4.3.1.tim2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio Engineering
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-18 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -64,7 +64,7 @@ homepage: http://github.com/appfolio/ae_page_objects
64
64
  licenses:
65
65
  - MIT
66
66
  metadata: {}
67
- post_install_message:
67
+ post_install_message:
68
68
  rdoc_options: []
69
69
  require_paths:
70
70
  - lib
@@ -79,9 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  - !ruby/object:Gem::Version
80
80
  version: 1.3.1
81
81
  requirements: []
82
- rubyforge_project:
83
- rubygems_version: 2.5.2
84
- signing_key:
82
+ rubygems_version: 3.1.4
83
+ signing_key:
85
84
  specification_version: 4
86
85
  summary: Capybara Page Objects pattern
87
86
  test_files: []