Test::Unit::TestCase 内の特定のテスト メソッド内で生成されたエラーを取得し、それをよりわかりやすい一般的なメッセージで失敗に変える方法が欲しいです。私はこれがいくつかの継承で可能であるべきだと考え続けていますが、私はそれを理解することはできません.
class CalenderTest001 < Test::Unit::TestCase
def testZoneCal001
Fixture.reset
$driver = Selenium::WebDriver.for :firefox
$driver.get "http://myTestSite.com/"
$driver.find_element(:id, "IDthrowsAnError").click
end
end
私が望む効果は、レスキューブロックがこのように見える開始レスキューエンドブロックで全体をラップすることです。
rescue Selenium::WebDriver::Error::NoSuchElementError => e
#mark this test as a failure not an error