New to Ruby testing

I just recently started coding in Ruby and began creating simple tests
combined with Selenium. Now however I want to create more advanced

The problem I have is that when I run my test for the search at my
website the test aborts when it hits an failure because of "Assert". I
have read about it and it's recommended to try to keep to 1 assert per
test to be able to find the fault more easily.

But when I try to divide my test in to smaller tests and create a Test
Suite/Case I don't know how to do it. I don't get how to do it. This is
my ugly code a the moment:

require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"

class CompleteTest < Test::Unit::TestCase
  def setup
    @verification_errors = []
    @selenium = \
  :host => "localhost",
  :port => 4444,
  :browser => "*chrome",
  :url => "http://localhost/",
  :timeout_in_second => 60

  def teardown
    assert_equal [], @verification_errors

  def test_Search "/"
    assert @selenium.is_element_present("id=query")
    @selenium.type("query", $query_miss)"searchSubmit", :wait_for => :page)
    assert @selenium.is_text_present("matchade inte några artiklar")
    @selenium.type("query", $query_hit)"searchSubmit", :wait_for => :page)
    assert @selenium.is_element_present("id=topSearchPagination")

Here I would like to make test_Search into several smaller tests that
fails one by one if the asserts return failure. But how do I configure
such a test? And also I want to be able to create new testcases along
the way?


Posted via