ae_page_objects 4.4.0.pre.rc.1 → 5.0.0.tim1
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dbfd8677597cf0026b13d31f3a468148cedab2df
|
4
|
+
data.tar.gz: 7385fcd650b5ea30d077e6fd7fcc23c997808fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bd1f9f15668d99c7ed9e9ff604bd54d23b5159d702b01188194b51fcc145614dc960bf242216fd7b7976b909523dc06a226e465cc5b4599c9b2b87d37665b1
|
7
|
+
data.tar.gz: 2de8621bfc85d7c66306af7c9761e3b0a57692bc307c97e2df1a23f003334867be5dd2cd039d5051c05add08e0e1dd1199972630ce2ddb1dba9ceb0b148d2fa2
|
data/lib/ae_page_objects.rb
CHANGED
@@ -16,7 +16,7 @@ module AePageObjects
|
|
16
16
|
autoload :Checkbox, 'ae_page_objects/elements/checkbox'
|
17
17
|
|
18
18
|
class << self
|
19
|
-
attr_accessor :default_router
|
19
|
+
attr_accessor :default_router
|
20
20
|
|
21
21
|
def browser
|
22
22
|
@browser ||= begin
|
@@ -45,7 +45,7 @@ module AePageObjects
|
|
45
45
|
result = call_wait_until_block(error_message, &block)
|
46
46
|
else
|
47
47
|
seconds_to_wait ||= default_max_wait_time
|
48
|
-
start_time =
|
48
|
+
start_time = Time.now
|
49
49
|
|
50
50
|
# In an effort to avoid flakiness, Capybara waits, rescues errors, reloads nodes, and
|
51
51
|
# retries.
|
@@ -71,7 +71,7 @@ module AePageObjects
|
|
71
71
|
errors += [WaitTimeoutError]
|
72
72
|
raise e unless errors.include?(e.class)
|
73
73
|
|
74
|
-
delay = seconds_to_wait - (
|
74
|
+
delay = seconds_to_wait - (Time.now - start_time)
|
75
75
|
|
76
76
|
if delay <= 0
|
77
77
|
# Raising the WaitTimeoutError in the rescue block ensures that Ruby attaches
|
@@ -80,7 +80,7 @@ module AePageObjects
|
|
80
80
|
end
|
81
81
|
|
82
82
|
sleep(0.05)
|
83
|
-
raise FrozenInTime, "Time appears to be frozen" if
|
83
|
+
raise FrozenInTime, "Time appears to be frozen" if Time.now == start_time
|
84
84
|
|
85
85
|
retry
|
86
86
|
end
|
@@ -106,4 +106,3 @@ end
|
|
106
106
|
|
107
107
|
require 'ae_page_objects/core/basic_router'
|
108
108
|
AePageObjects.default_router = AePageObjects::BasicRouter.new
|
109
|
-
AePageObjects.time_keeper = Time
|
@@ -16,6 +16,7 @@ module AePageObjects
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def visible?(options = {})
|
19
|
+
options[:wait] ||= 0
|
19
20
|
wait_until_visible(options[:wait])
|
20
21
|
true
|
21
22
|
rescue ElementNotVisible
|
@@ -23,6 +24,7 @@ module AePageObjects
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def hidden?(options = {})
|
27
|
+
options[:wait] ||= 0
|
26
28
|
wait_until_hidden(options[:wait])
|
27
29
|
true
|
28
30
|
rescue ElementNotHidden
|
@@ -30,6 +32,7 @@ module AePageObjects
|
|
30
32
|
end
|
31
33
|
|
32
34
|
def present?(options = {})
|
35
|
+
options[:wait] ||= 0
|
33
36
|
wait_until_present(options[:wait])
|
34
37
|
true
|
35
38
|
rescue ElementNotPresent
|
@@ -37,6 +40,7 @@ module AePageObjects
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def absent?(options = {})
|
43
|
+
options[:wait] ||= 0
|
40
44
|
wait_until_absent(options[:wait])
|
41
45
|
true
|
42
46
|
rescue ElementNotAbsent
|
@@ -133,12 +133,12 @@ module AePageObjects
|
|
133
133
|
private
|
134
134
|
|
135
135
|
def recognizer
|
136
|
-
@recognizer ||= case ::Rails.
|
137
|
-
when
|
136
|
+
@recognizer ||= case ::Rails.version
|
137
|
+
when /\A3\.[01]/
|
138
138
|
Recognizer::Rails3.new
|
139
|
-
when
|
139
|
+
when /\A3\.2/
|
140
140
|
Recognizer::Rails32.new
|
141
|
-
when
|
141
|
+
when /\A(4\.[012]|5\.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."
|
@@ -6,13 +6,13 @@ module AePageObjects
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def using_wait_time
|
9
|
-
start_time =
|
9
|
+
start_time = Time.now
|
10
10
|
@wait_time = [@wait_time, @max_time].min
|
11
11
|
Capybara.using_wait_time(@wait_time) do
|
12
12
|
yield
|
13
13
|
end
|
14
14
|
ensure
|
15
|
-
if
|
15
|
+
if Time.now - start_time > @wait_time
|
16
16
|
@wait_time *= 2
|
17
17
|
end
|
18
18
|
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
|
+
version: 5.0.0.tim1
|
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:
|
11
|
+
date: 2018-12-20 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,8 +79,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 1.3.1
|
81
81
|
requirements: []
|
82
|
-
|
83
|
-
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.5.2
|
84
|
+
signing_key:
|
84
85
|
specification_version: 4
|
85
86
|
summary: Capybara Page Objects pattern
|
86
87
|
test_files: []
|