|
|
|
Fri, 09 Dec 2005
Selenium on Rails
Once again I find myself distracted from my writing. Last time it was Ajax, and this time it's the killer combination of Rails and Selenium. I've joined the Selenium project to help improve the dynamic language drivers. My first goal is to integrate "driven" Selenium with Rails. Last night I spiked it against a partially developed Depot.
Here's the test case:
require File.dirname(__FILE__) + "/seletest"
class ExampleTest < Test::Unit::TestCase
def test_something
open '/admin/list'
verify_text_present 'Listing products'
click_and_wait 'newProduct'
click_and_wait 'commit'
verify_text_present 'Price should be positive'
end
end
And here's a screenshot of Selenium driving Rails.
As I added to the number and complexity of test cases, I followed Brian's advice and moved to a more declarative style. I'll have more to say about this in the weeks ahead.
[/projects/selenium]
permanent link
|