ae_page_objects 4.0.0.pre3 → 4.0.0.pre4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ae_page_objects/document.rb +11 -0
- data/lib/ae_page_objects/element.rb +4 -2
- data/lib/ae_page_objects/element_proxy.rb +13 -2
- data/lib/ae_page_objects/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b784c0522c2e291327f19338dadb8c97a7ab028
|
4
|
+
data.tar.gz: da4ea7af94b30de00765d0bc781fbacdf466ba02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 331e3411ccb7f9a2b27f32ec7f3958f9fe3fe3390edc96064fc5ebc9929bcea732f4902a614dc93d7c655b21fa1d24bdb1804597c40988a80bcf495c708f4047
|
7
|
+
data.tar.gz: f9e55883730b956970ccd80dde9c72f7c25457f9769b5184697e16a4969322d103a2245aad800b949b89968acf3b3f440f79e985a435ae2f3c4d8dfbf272673c
|
@@ -67,6 +67,17 @@ module AePageObjects
|
|
67
67
|
self
|
68
68
|
end
|
69
69
|
|
70
|
+
def reload(timeout: nil)
|
71
|
+
Capybara.current_session.driver.execute_script <<-SCRIPT
|
72
|
+
document.body.classList.add('reloading');
|
73
|
+
location.reload(true);
|
74
|
+
SCRIPT
|
75
|
+
|
76
|
+
element('body.reloading').wait_until_absent(timeout)
|
77
|
+
ensure_loaded!
|
78
|
+
self
|
79
|
+
end
|
80
|
+
|
70
81
|
private
|
71
82
|
|
72
83
|
def ensure_loaded!
|
@@ -74,9 +74,11 @@ module AePageObjects
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def reload_descendents
|
77
|
+
# Reload the parent first, traversing up until we hit the document
|
77
78
|
parent.reload_descendents if parent.respond_to?(:reload_descendents)
|
78
|
-
|
79
|
-
|
79
|
+
|
80
|
+
# Tell the capybara node to reload
|
81
|
+
@node.reload
|
80
82
|
ensure_loaded!
|
81
83
|
end
|
82
84
|
|
@@ -100,10 +100,21 @@ module AePageObjects
|
|
100
100
|
|
101
101
|
implicit_element.__send__(name, *args, &block)
|
102
102
|
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
103
|
+
#
|
103
104
|
# A StaleElementReferenceError can occur when a selenium node is referenced but is no longer attached to the DOM.
|
104
105
|
# In this case we need to work our way up the element tree to make sure we are referencing the latest DOM nodes.
|
105
|
-
|
106
|
-
|
106
|
+
#
|
107
|
+
# In some cases we get this exception and cannot recover from it. This usually occurs when code outside of
|
108
|
+
# ae_page_objects calls capybara queries directly. In these cases we need to raise the original exception
|
109
|
+
#
|
110
|
+
@retry_count ||= 0
|
111
|
+
@retry_count += 1
|
112
|
+
if @retry_count < 5
|
113
|
+
implicit_element.reload_descendents
|
114
|
+
retry
|
115
|
+
else
|
116
|
+
raise
|
117
|
+
end
|
107
118
|
end
|
108
119
|
|
109
120
|
def respond_to?(*args)
|
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.0.0.
|
4
|
+
version: 4.0.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donnie Tognazzini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|