test-factory 0.4.9 → 0.5.0
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 +8 -8
- data/lib/test-factory/gem_ext.rb +2 -0
- data/lib/test-factory/page_factory.rb +4 -3
- data/test-factory.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDgzYzM4Yjc1NjA4ZjAyYzdjMzBjMmM2NDRmNTNiYTEyMjEwMDYwZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDVjNTBhMDg3NjllZjQ2OTZhMTlhY2MzYTI2NzMyOWYzY2U5YjMwZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjIwNWIzM2M4OWRhM2M0OWRhNmQ1MTFmMzNjZjQ0NmYzZWFhZmZiZmNkNWU4
|
10
|
+
ZDI1ODZiNWVlZGQ2NmVlYjVhMWFkYzVmNTYyMWY4YmE1ZWI3NGEzNDkzNDQ4
|
11
|
+
YWVhZGZhYWIzYzA0NjlhMTQ5OWY0Njc1ZmQ3MjI2NTBkNjJhNGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWFmOWM5MDMxYWEyZmNmY2MxMThmZDE2MjdiZGRlNjBkYTRiNzI3Y2U0MTNi
|
14
|
+
Y2NiZWFkYWQyNzA0MDhhNzc3OTQxN2IyMzBlYjc0ZDJhYzRhMjNjYmZlOTgx
|
15
|
+
ZGUwNmJiYjk3Njk4N2ZjN2E4OTFiNGExMTMwMjJlNDFjMzUyN2Y=
|
data/lib/test-factory/gem_ext.rb
CHANGED
@@ -202,6 +202,8 @@ module Watir
|
|
202
202
|
|
203
203
|
def select_at_random
|
204
204
|
ar = options.map(&:text)
|
205
|
+
# Must break out of this method if the select list has nothing to select...
|
206
|
+
return '::random::' if ar.size==1 && (ar[0]=~/^select(.?)$/i || ar[0]=='')
|
205
207
|
sel = ar.sample
|
206
208
|
while sel=~/^select(.?)$/i || sel==''
|
207
209
|
sel = ar.sample
|
@@ -153,15 +153,16 @@ class PageFactory
|
|
153
153
|
# Creates a method, #wait_for_ajax, usable in your Page Classes, that executes
|
154
154
|
# the 'jQuery.active' Javascript snippet each second until timeout.
|
155
155
|
#
|
156
|
-
# If timeout is exceeded, raises Watir::Wait::TimeoutError exception.
|
156
|
+
# If timeout is exceeded, raises Watir::Wait::TimeoutError exception. The returned error
|
157
|
+
# message is customizable.
|
157
158
|
#
|
158
|
-
define_method 'wait_for_ajax' do |timeout=10|
|
159
|
+
define_method 'wait_for_ajax' do |timeout=10, message|
|
159
160
|
timeout.times do
|
160
161
|
sleep 0.3
|
161
162
|
return true if @browser.execute_script('return jQuery.active').to_i == 0
|
162
163
|
sleep 0.7
|
163
164
|
end
|
164
|
-
raise Watir::Wait::TimeoutError, "Ajax calls continued beyond #{timeout} seconds."
|
165
|
+
raise Watir::Wait::TimeoutError, "Ajax calls continued beyond #{timeout} seconds. #{message}"
|
165
166
|
end
|
166
167
|
|
167
168
|
}
|
data/test-factory.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'test-factory'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.5.0'
|
4
4
|
s.summary = %q{rSmart's framework for creating automated testing scripts}
|
5
5
|
s.description = %q{This gem provides a set of modules and methods to help quickly and DRYly create a test automation framework using Ruby and Watir (or watir-webdriver).}
|
6
6
|
s.files = Dir.glob("**/**/**")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abraham Heward
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: watir-webdriver
|