Forum: Ruby on Rails Alternative take on Selenium in Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
337cdd270761e0e6f4356de45b04d388?d=identicon&s=25 Jonathan Viney (jonny)
on 2006-02-09 13:10
Hey there,

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/selen...,
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
    selenium_test
    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
  end

This will be turned into a Selenium test suite when you run:

  rake selenium

Anyway, enough for the forum. Check out the plugin if you're interested.
It's still quite rough, but it Works For Me.

- Jonny.
337cdd270761e0e6f4356de45b04d388?d=identicon&s=25 Jonathan Viney (jonny)
on 2006-02-09 13:12
Jonathan Viney wrote:
> Check out my blog post at
> http://blog.viney.net.nz/articles/2006/02/09/selen...,
> grab the plugin and give it a whirl (be sure to read the README!).

Sorry, the link got stuffed up. It should be
http://blog.viney.net.nz/articles/2006/02/09/selen...

- Jonny.
This topic is locked and can not be replied to.