简体   繁体   中英

How to specify setup and teardown in Selenium On Rails?

I use Selenium On Rails to do some acceptance test, but before most of tests I need to create some binary test files associated with fixtures, and after each test - remove them. I don't know how to do it. I was searching some kind of setup/teardown functions but I couldn't find.

Usually people use an acceptance test framework like Webrat and set it up to use selenium. To configure Webrat to use selenium, this is how you would set it up in test_helper.rb :

require "webrat"

Webrat.configure do |config|
 config.mode = :selenium
end

Then I would define my setup and teardown in the test code. Would you be interested with this approach?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM