Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create rake jasminerice:ci to mimic rake jasmine:ci #53

Open
dimroc opened this issue Jul 17, 2012 · 2 comments
Open

Create rake jasminerice:ci to mimic rake jasmine:ci #53

dimroc opened this issue Jul 17, 2012 · 2 comments

Comments

@dimroc
Copy link
Contributor

dimroc commented Jul 17, 2012

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
Copy link
Contributor Author

dimroc commented Jul 19, 2012

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

@jeffsaracco
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants