jasminerice icon indicating copy to clipboard operation
jasminerice copied to clipboard

Create rake jasminerice:ci to mimic rake jasmine:ci

Open dimroc opened this issue 12 years ago • 2 comments

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:/jasmine just renders a File not found: /jasmine error.

This would be extremely useful for those hoping to run jasmine specs through selenium in a browser (useful when working with WebGL).

dimroc avatar Jul 17 '12 03:07 dimroc

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

dimroc avatar Jul 19 '12 23:07 dimroc

You can use the guard-jasmine (https://github.com/netzpirat/guard-jasmine) gem to achieve the same result

jeffsaracco avatar Mar 13 '13 18:03 jeffsaracco