jasminerice
jasminerice copied to clipboard
Create rake jasminerice:ci to mimic rake jasmine:ci
rake jasmine:ci does not work because it expects javascript files and does run the rails server ( mount the asset pipeline ).
I've had an attempt at it but altering selenium path to localhost:
This would be extremely useful for those hoping to run jasmine specs through selenium in a browser (useful when working with WebGL).
A work around I've made for this is to create a capybara request spec that visits "/jasmine" and ensures all jasmine specs have passed.
You can find a sample here: https://gist.github.com/3147449
It does not report each individual failing test, but I wanted to avoid using too much javascript through selenium.
require 'spec_helper'
# For use alongside Jasminerice
# Requirements: Capybara, Underscorejs
# Remember this is a request spec, so place in spec/requests/ or
# tag scenario with request: tue.
feature "JasmineSpecs" do
scenario "should all pass", js: true do
visit "/jasmine"
wait_until do
page.evaluate_script("jsApiReporter.finished")
end
jasmine_results =
page.evaluate_script(<<-TRUTH_JS)
_.all(jsApiReporter.results(), function(r) { return r.result == "passed"} )
TRUTH_JS
jasmine_results.should be_true
end
end
You can use the guard-jasmine (https://github.com/netzpirat/guard-jasmine) gem to achieve the same result