#10
Jan 04, 2009

Selenium

Selenium is a great way to test your app automatically through a browser. See how it works in this episode.
Selenium是一个通过浏览器自动测试程序的工具.这个视频里讲述Selenium如何运行.

Tags: tools testing
Bittorrent 种子下载 推荐使用 (11.8 MB, 9:21)
直接下载/Direct Download Link (11.8 MB, 9:21)
script/plugin install git://github.com/ryanb/selenium-on-rails.git
script/generate selenium destroy_product.rsel
rake test:acceptance


# test/selenium/destroy_product.rsel
setup :fixtures => :all
product = Product.first
open '/'
click "css=#product_#{product.id} a:contains('Destroy')"
assert_confirmation('*')
wait_for_element_present "css=#flash_notice"
assert_element_not_present "css=#product_#{product.id}"
refresh
assert_element_not_present "css=#product_#{product.id}"

# config/selenium.yml
environments:
  - test

browsers:
  firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
  safari: '/Applications/Safari.app/Contents/MacOS/Safari'

添加留言:/Add your comment:

(SKIP THIS ONE)

(required)

(not shown)


(可以使用pastie或者gist添加代码) (use pastie or gist for code)

if you want to help:
required:
BT下载工具
Get Bittorrent Tool
VLC播放器
Get VLC Media Player