There’s been a bit of work going on with Selenium and Rails recently, so
I thought I may as well share what I came up with. Check out my blog
post at http://blog.viney.net.nz/articles/2006/02/09/selenium-testing,
grab the plugin and give it a whirl (be sure to read the README!).
Basically, my approach was to make it possible to write Selenium tests
in the same way that unit and functional tests are written. So, you end
up with test classes such as:
class PersonSeleniumTest < Test::Unit::TestCase
fixtures :people, :households
def setup open '/person/view/1' end def test_add_new_person click 'add_new_person_link' assert_visible 'add_new_person' type 'new_person_first_name', 'Pixel' type 'new_person_last_name', 'the Cat' select 'new_person_gender', 'Male' type 'new_person_creation_source', 'The Planet Zorg' click_and_wait 'submit_add_new_person', 4 assert_contains 'person_name', 'Pixel the Cat' end
This will be turned into a Selenium test suite when you run:
Anyway, enough for the forum. Check out the plugin if you’re interested.
It’s still quite rough, but it Works For Me.