This project is dead. You should use Karma instead. I do.
Go to file
2011-07-13 23:37:37 -07:00
bin fix other half of #19, better error reporting and exceptions 2011-06-19 15:08:18 -04:00
ext/jasmine-webkit-specrunner show line numbers for spec failures, whoa nelly 2011-07-13 14:42:47 -04:00
jasmine show line numbers for spec failures, whoa nelly 2011-07-13 14:42:47 -04:00
lib show line numbers for spec failures, whoa nelly 2011-07-13 14:42:47 -04:00
spec show line numbers for spec failures, whoa nelly 2011-07-13 14:42:47 -04:00
.gitignore Added the .idea/ sub-directory to the .gitignore file. 2011-07-13 22:58:07 -07:00
.rspec more stuff, like console.log error code and others 2011-04-13 20:21:23 -04:00
CHANGELOG.md changelog for, like, the last one million versions 2011-07-12 08:48:51 -04:00
Gemfile only call the coffeescript compiler as much as needed. so much faster 2011-06-10 14:18:35 -04:00
Guardfile factor out file list management 2011-06-10 10:04:21 -04:00
jasmine-headless-webkit.gemspec show line numbers for spec failures, whoa nelly 2011-07-13 14:42:47 -04:00
Rakefile update rakefile for rake >= 0.9.0 2011-06-19 16:11:22 -04:00
README.md Modifed the README.md to give more specific configuration instructions, updated headers. 2011-07-13 23:37:37 -07:00

Jasmine Headless WebKit Runner

Run your specs at sonic boom speed! No pesky reload button or page rendering slowdowns! Jasmine Headless WebKit Runner is a great way to run continuous integration without running a Web browser, such as FireFox or Chrome.

Install Jasmine Headless WebKit

The simplest way to install Jasmine Headless Webkit is to install it via the Gemfile. Add gem "jasmine-headless-webkit" to your Gemfile, and run bundle install. This gem has three gem dependencies:

 coffee-script >= 2.2
 jasmine ~> 1.1.beta
 rainbow >= 0

Next, run bundle install

Configure Jasmine

In the jasmine.yml file, located under the support sub-directory, you can control which source files you would like to test. The default line that includes all JavaScript files is public/javascripts/**/*.js, but this does not guarantee an order of execution. It is recommended that you include files that jQuery plug-ins may depend on first.

 src_files:
   public/javascripts/jquery.min.js
   public/javascripts/underscore.js
   public/javascripts/underscore.date.min.js
   public/javascripts/jquery-ui-1.8.14.custom.min.js
   public/javascripts/**/*.js

Continuous Integration

Since most continuous integration servers do not have a display, you will need to use Xvfb or virtual framebuffer Xserver for Version 11 [Xvfb Manpages] (http://manpages.ubuntu.com/manpages/natty/man1/Xvfb.1.html).

  1. sudo apt-get install xvfb
  2. run Xvfb :99 -ac and resolve missing dependencies.
    •    `sudo apt-get install x11-xkb-utils`
      
    •    `sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic`
      
    •    `sudo apt-get install xserver-xorg-core`
      
  3. Use Xvfb to run the headless rake command xvfb-run rake jasmine:headless or xvfb-run jasmine-headless-webkit -c
  4. Reference: MARTIN DALE LYNESS

Gotcha(s)

Qt 4.7.X

The gem is compiled using qt4-qmake and you will need Qt 4.7.x or greater. To test if it is installed, you should run qmake --version and you should receive something like:

 QMake version 2.01a
 Using Qt version 4.7.2 in /usr/lib

If you receive a different message, you can install qt4-qmake using the following commands as root:

Ubuntu 11.04

 sudo apt-get install libqt4-dev
 sudo apt-get install qt4-qmake

Mac OS X 10.6

 sudo port install qt4-mac

Ubuntu 9.10

Running sudo apt-get install libqt4-dev and sudo apt-get install qt4-qmake will install qt4, but it installs version 4.5.2, which will not be able to install gem "jasmine-headless-webkit", as it requires Qt 4.7.X or later version.

You will need to compile qt4-qmake from source Qt version 4.7.0. There are excellent directions on how to compile the source code. You will need to ensure Qt is exported to your $PATH before using qmake, as it will install to /usr/local/Trolltech/.

RubyMine

RubyMine may throw an error when running rake spec, you will need to provide a JavaScript runtime environment. Install gem "therubyracer" to resolve this problem.

 rake aborted!
 Could not find a JavaScript runtime.
 See https://github.com/sstephenson/execjs
 for a list of available runtimes.

http://johnbintz.github.com/jasmine-headless-webkit/ has the most up-to-date information on using this project. You can see the source of that site on the gh-pages branch.

License

  • Copyright (c) 2011 John Bintz
  • Original Qt WebKit runner Copyright (c) 2010 Sencha Inc.
  • Jasmine JavaScript library Copyright (c) 2008-2011 Pivotal Labs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.