test-harness 0.4.11 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.11
1
+ 0.4.12
data/lib/configuration.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class TestHarness
2
2
  class Configuration
3
- attr_accessor :browser, :server_host, :autoload_path, :namespace
3
+ attr_accessor :browser, :server_host, :autoload_path, :namespace, :ajax_timeout
4
4
 
5
5
  def setup_cucumber_hooks(scope)
6
6
  scope.Before do
@@ -40,6 +40,14 @@ class TestHarness
40
40
  end
41
41
  end
42
42
 
43
+ def wait_for_ajax
44
+ start_time = Time.now
45
+ until page.evaluate_script('jQuery.isReady&&jQuery.active==0') or (start_time + ajax_timeout) < Time.now do
46
+ sleep 1
47
+ end
48
+ yield if block_given?
49
+ end
50
+
43
51
  # Since Kernel#select is defined, we have to override it specifically here.
44
52
  def select(*args, &block)
45
53
  browser.within(component.within) do
@@ -109,5 +117,9 @@ class TestHarness
109
117
  def server_host
110
118
  configuration.server_host || Capybara.default_host || 'http://example.com'
111
119
  end
120
+
121
+ def ajax_timeout
122
+ (configuration.ajax_timeout || 5).to_i.seconds
123
+ end
112
124
  end
113
125
  end
data/test-harness.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "test-harness"
8
- s.version = "0.4.11"
8
+ s.version = "0.4.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Maher Hawash"]
12
- s.date = "2013-04-09"
12
+ s.date = "2013-04-25"
13
13
  s.description = "A test harness for rspec and cucumber which allows for separating responsibility between setting up the context and interacting with the browser, and cleaning up the step definition files."
14
14
  s.email = "gmhawash@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-09 00:00:00.000000000 Z
12
+ date: 2013-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -553788856980005565
149
+ hash: -164941201530053683
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements: