Browse files

Wait for suite to complete before reporting results

  • Loading branch information...
1 parent 6d254f2 commit fa0e2f3512da0673e785a8d26f6095ade17f6561 @jnicklas jnicklas committed Aug 6, 2010
View
3 lib/evergreen/resources/evergreen.js
@@ -16,6 +16,9 @@ Evergreen.ReflectiveReporter = function() {
trace: item.trace
});
};
+ this.reportSuiteResults = function(suite) {
+ Evergreen.done = true;
+ };
};
Evergreen.templates = {};
View
1 lib/evergreen/runner.rb
@@ -51,6 +51,7 @@ def results
@results ||= begin
session = Capybara::Session.new(:selenium, Evergreen.application(spec.root, :selenium))
session.visit(spec.url)
+ session.wait_until(180) { session.evaluate_script('Evergreen.done') }
JSON.parse(session.evaluate_script('Evergreen.getResults()'))
end
end
View
5 spec/meta_spec.rb
@@ -21,6 +21,11 @@
let(:template) { 'templates_spec.js' }
it { should pass }
end
+
+ context "with slow failing spec" do
+ let(:template) { 'slow_spec.coffee' }
+ it { should_not pass }
+ end
end
end
View
8 spec/suite1/spec/javascripts/slow_spec.coffee
@@ -0,0 +1,8 @@
+describe 'slow specs', ->
+
+ it "should wait for results to show", ->
+ runs ->
+ expect('foo').toEqual('foo')
+ waits 1000
+ runs ->
+ expect('bar').toEqual('baz')

0 comments on commit fa0e2f3

Please sign in to comment.