From cbdb553c425891d91019a6cf6d6098007df2ba0b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 23 Feb 2012 20:34:02 -0500 Subject: [PATCH] better selenium support --- features/basic_run.feature | 2 ++ .../flowerbox/jasmine/selenium.js.coffee | 5 +--- lib/flowerbox/runner/selenium.rb | 26 ++++++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/features/basic_run.feature b/features/basic_run.feature index 4f6f8a5..377e009 100644 --- a/features/basic_run.feature +++ b/features/basic_run.feature @@ -15,6 +15,8 @@ Feature: Basic Run """ class Cat meow: -> "meow" + + console.log("made it") """ Scenario: Use the Node runner using Jasmine diff --git a/lib/assets/javascripts/flowerbox/jasmine/selenium.js.coffee b/lib/assets/javascripts/flowerbox/jasmine/selenium.js.coffee index f20777a..dd860ff 100644 --- a/lib/assets/javascripts/flowerbox/jasmine/selenium.js.coffee +++ b/lib/assets/javascripts/flowerbox/jasmine/selenium.js.coffee @@ -1,6 +1,3 @@ class jasmine.SimpleSeleniumReporter reportRunnerResults: (runner) -> - xhr = new XMLHttpRequest() - xhr.open("POST", "/results") - xhr.send(runner.results().totalCount + '/' + runner.results().failedCount) - + Flowerbox.contact("results", runner.results().totalCount + '/' + runner.results().failedCount) diff --git a/lib/flowerbox/runner/selenium.rb b/lib/flowerbox/runner/selenium.rb index a6d0e32..356b073 100644 --- a/lib/flowerbox/runner/selenium.rb +++ b/lib/flowerbox/runner/selenium.rb @@ -18,7 +18,11 @@ module Flowerbox end post '/results' do - runner.results = request.env['rack.input'].read + runner.results = request.body.string + end + + post '/log' do + runner.log(request.body.string) end get %r{^/__F__(/.*)$} do |file| @@ -63,6 +67,10 @@ module Flowerbox end end + def log(msg) + puts msg + end + def template env = start_test_environment @@ -70,6 +78,22 @@ module Flowerbox Flowerbox - Selenium Runner + #{template_files.join("\n")}