xpage 0.5.7 → 0.5.8
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/xpage.rb +14 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bce7db88d2d8daf10d4492348652e101ea486e3d
|
4
|
+
data.tar.gz: c06629486c301142fce63eb04ac0cace6666b41a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d307d6f500bcb87211271a627f79137eec4bbdccc8de7c0c163f9fa54bb37d1fbcd74de91287282a39fbecc63864efb84ccfd58c1bad286bbd8d6dff09487f
|
7
|
+
data.tar.gz: a1b0011cc0af816fc5f4afcee82a31506951491b4f585e22d33f09e4de28099f482a80b5926fef97bba837b32ffe53093aca2bae877f8eb7168f597dd96dc91b
|
data/lib/xpage.rb
CHANGED
@@ -8,6 +8,8 @@ class Xpage
|
|
8
8
|
@@wait = Retryer::Wait.new(:timeout => 20, :interval => 1, :verbose => false)
|
9
9
|
@@retryer = Retryer::Retry.new(max_retries: 5, interval: 1, :verbose => true)
|
10
10
|
|
11
|
+
SLEEP_DURATION = 0.2
|
12
|
+
|
11
13
|
def get_element(xpath)
|
12
14
|
@@retryer.do(description: 'get_element') {
|
13
15
|
begin
|
@@ -21,12 +23,17 @@ class Xpage
|
|
21
23
|
def click_xpath(xpath)
|
22
24
|
wait_for_xpath_to_display xpath
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
begin
|
27
|
+
@@retryer.do(description: 'click_xpath') {
|
28
|
+
sleep(DURATION)
|
29
|
+
element = get_element xpath
|
30
|
+
element.click
|
31
|
+
}
|
32
|
+
rescue e
|
33
|
+
p "WARNING: Couldn't click_xpath #{xpath} with error: #{e}"
|
34
|
+
end
|
28
35
|
end
|
29
|
-
|
36
|
+
|
30
37
|
def get_xpath_attribute(xpath, attribute)
|
31
38
|
wait_for_xpath_to_exist xpath
|
32
39
|
|
@@ -71,7 +78,7 @@ class Xpage
|
|
71
78
|
Selenium::WebDriver::Support::Select.new(element).select_by(:text, option)
|
72
79
|
}
|
73
80
|
end
|
74
|
-
|
81
|
+
|
75
82
|
def send_keys(args)
|
76
83
|
@@retryer.do(description: 'send_keys') {
|
77
84
|
@@driver.action.send_keys(args).perform
|
@@ -184,7 +191,7 @@ class Xpage
|
|
184
191
|
element.selected?
|
185
192
|
}
|
186
193
|
end
|
187
|
-
|
194
|
+
|
188
195
|
def method_missing(method, *args, &block)
|
189
196
|
method = method.to_s
|
190
197
|
if method[-11..-1]=='_displayed?'
|