- Speed – browsers are getting extremely quick at this DOM stuff.
- Flexibility – everything happens client-side meaning you can easily test with any server technology.
The basic file structure is very similar to Cucumber:
- features index.html - js ramble.js jquery-1.4.2.js my.feature - steps web-steps.js - support paths.js
Scenarios are exactly the same as in Cucumber, so you can do something like the following:
Scenario: User fill out a form Given I am on the homepage And I follow "Tell us your name" And I fill in "First name" with "Jamie" And I fill in "Last name" with "Hill" And I press "Submit" Then I should see "Thank you for your details."
You can now simply drop the features folder into the public area of your app and visit the url in your browser. You should see the relevant steps go green or red as the app is navigated in an iFrame.
I plan to first tidy up the API (and unit test) and then aid the writing of scenarios by adding the ability to record them within the browser (Selenium style).
I’d like to hear peoples views on this… please don’t be too hard on the code, it’s more of a mind-dump than anything else at this stage (around 100 lines). There is an example of testing a static site included so just load the features/index.html file in your browser to see it run.
Update 04/07/10: As noted by Andrew in the comments, you will need a server running in order for browsers to get access to the pages for testing.
I have added a simple server script allowing the features to be run locally (requires Ruby). If you want to see it in action, just run:
cd /path/to/ramble/checkout ruby server.rb
…and then visit http://localhost:1234/features in your browser (tested in Firefox, Chrome and Safari). Note that Ramble is not at all dependent on Ruby, it is just used for running a local test server.