Unlike unit tests, acceptance tests should be very high-level, describing the functionality and features an end-user wants to see. Additionally, the tests should be highly expressive such that an end-user can make sense of their intent and, ideally, add to the suite of acceptance tests themselves. RSpec was chosen for its readability and ability to run Watir-WebDriver (although a tool like Cucumber could drive this even farther).
Running the tests
Assuming you have
rubygems installed, run:
$ [sudo] gem install rspec
The easiest way to get and run this test suite is:
$ git clone git://github.com/stenington/webxray-acceptance.git $ cd ./webxray-acceptance $ rspec
rspec looks for
./spec/**/*_spec.rb and runs all the files it finds.
RSpec output formatting
A nice alternative output can be specified like so:
$ rspec --format documentation
or more concisely:
$ rspec -f
rspec -h for more formatters.
Rakefile also defines some shortcuts and defaults for running the suite.
rake -T will list the available targets.
- Moar tests!
- It would be nice to easily control where the bookmarklet points (i.e. DEV vs. production goggles)
- Option to run headlessly
- RSpec has lots of utilities that increase conciseness and expressivity—explore them!
- Move from testing on hackasaurus.org to a checked-in page