Updated Testing (textile)

lrbalt 2012-03-13 11:58:43 -07:00
parent 6d9343fe73
commit 14eacc8461

@ -23,7 +23,7 @@ Assuming you've already checked out the source code using git, change to the roo
<pre>
<code>
rake test
bundle exec rake test
</code>
</pre>
@ -35,45 +35,35 @@ To run the Rspec tests run
<pre>
<code>
rake spec
bundle exec rake spec
</code>
</pre>
h2. Running the cucumber test suite
For integration testing Tracks uses cucumber. For those features that require javscript/ajax, Tracks uses Selenium on Webrat
For integration testing Tracks uses cucumber. For those features that require javscript/ajax, Tracks uses Selenium and Capybara
To run the features excluding the selenium features and the work-in-progress (wip) features, run
To run all the features excluding the work-in-progress (wip) features, run
<pre>
<code>
rake cucumber
bundle exec rake cucumber
</code>
</pre>
To run the features that make use of Selenium on Webrat, run
<pre>
<code>
rake cucumber:selenium
</code>
</pre>
This will execute all features, including those using Selenium.
To run the features that are work in progress run these:
<pre>
<code>
rake cucumber:selenium_wip
rake cucumber:wip
bundle exec rake cucumber:wip
</code>
</pre>
To run a feature by hand run these. Please note the different RAILS_ENV value and the -p usage for selenium:
To run a feature by hand run these.
<pre>
<code>
RAILS_ENV=cucumber cucumber features/my_feature.feature
RAILS_ENV=selenium cucumber -p selenium features/my_feature.feature
bundle exec cucumber features/my_feature.feature
</code>
</pre>
@ -83,13 +73,28 @@ h2. Running the tests headless
All tests will run on a headless setup except for the selenium tests. They will need a webbrowser which will need a running X-server.
You can solve this by running a virtual framebuffer X server. In Fedora, you need to install the packages xorg-x11-server-Xvfb and xorg-x11-apps
You can solve this by running a virtual framebuffer X server or by using the capybara-webkit driver.
h3. Using webkit
Uncomment the capybara-webkit gem in the Gemfile and run bundle install. This will need the Qt development libraries on your system.
Run the features using webkit:
<pre>
<code>
bundle exec rake cucumber JS_DRIVER=webkit
</code>
</pre>
h3. Framebuffer
For the framebuffer in Fedora, you need to install the packages xorg-x11-server-Xvfb and xorg-x11-apps
<pre>
<code>
Xvfb :99 -ac -screen 0 1024x768x16 &
DISPLAY=:99.0 rake cucumber:selenium
DISPLAY=:99.0 bundle exec rake cucumber:selenium
killall Xvfb
</code>
@ -103,7 +108,7 @@ To run the suite simply run Tracks in the test environment:
<pre>
<code>
script/server -e test
bundle exec script/server -e test
</code>
</pre>
@ -111,7 +116,7 @@ in a separate command window, then run
<pre>
<code>
rake test:acceptance
bundle exec rake test:acceptance
</code>
</pre>
@ -123,7 +128,7 @@ h2. Problems with cucumber selenium tests
h3. Tests doesn't start
Firefox 3.x is required to run the selenium tests properly. It's also recommanded to use an english version, to avoid problems due to the locale.
Firefox 3.x is required to run the selenium tests properly. It's also recommended to use an english version, to avoid problems due to the locale.
You can get an old version of firefox "here":http://www.mozilla.org/en-US/firefox/all-older.html.
h3. Sqlite3 Lock exceptions