test-factory 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjM2NDE3ZTk1MzI5ZjgyYjhhYjI2Zjg4MGY1NWQ3NmQ4MDk0MDgwMg==
4
+ NDgzYzM4Yjc1NjA4ZjAyYzdjMzBjMmM2NDRmNTNiYTEyMjEwMDYwZA==
5
5
  data.tar.gz: !binary |-
6
- ZDM2NzNjNmJkN2I0MTcwODc3MDg5ODc3MjM3YTczZTA2MjdkNTE2NQ==
6
+ NDVjNTBhMDg3NjllZjQ2OTZhMTlhY2MzYTI2NzMyOWYzY2U5YjMwZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODhjMDg0OTE0OTkwODczZGM0YjZhNTUyYTE0MmVhNjE5MjNiNjg3M2QwOTkz
10
- MmQxZjE3NWE5N2E4MjM2N2VkMDJjZTI3OWMwYWY1MTM2MWJiZGNiNjZkYjAx
11
- MmIyOGM1ZjU4ZjhlNDk3MmVlM2RlODRkYmE0OGQ1NWYwOTg2MmU=
9
+ NjIwNWIzM2M4OWRhM2M0OWRhNmQ1MTFmMzNjZjQ0NmYzZWFhZmZiZmNkNWU4
10
+ ZDI1ODZiNWVlZGQ2NmVlYjVhMWFkYzVmNTYyMWY4YmE1ZWI3NGEzNDkzNDQ4
11
+ YWVhZGZhYWIzYzA0NjlhMTQ5OWY0Njc1ZmQ3MjI2NTBkNjJhNGQ=
12
12
  data.tar.gz: !binary |-
13
- ZjU2MjEwMTdmOTkzMDU4NzJmY2JmODU2YmE0NjNjYTAyYzE0NDA5ODg5NWUx
14
- ZDA2Y2M5YTQzNjgwOWJjYzIyNjEzZDM2MzBlNDc4MTc2ZThhNjNiYWIwZTI1
15
- YTFmMTkwMWY4NjZjZWJkMThkMDQwMGVhYTczYTcxNjY2NmIyOGE=
13
+ YWFmOWM5MDMxYWEyZmNmY2MxMThmZDE2MjdiZGRlNjBkYTRiNzI3Y2U0MTNi
14
+ Y2NiZWFkYWQyNzA0MDhhNzc3OTQxN2IyMzBlYjc0ZDJhYzRhMjNjYmZlOTgx
15
+ ZGUwNmJiYjk3Njk4N2ZjN2E4OTFiNGExMTMwMjJlNDFjMzUyN2Y=
@@ -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.4.9'
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.9
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-23 00:00:00.000000000 Z
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir-webdriver