+ -

配置cucumber上Capybara使用selenium驱动

时间:2011-05-02

来源:LunaticT

在手机上看
手机扫描阅读

1. 首先gem list查看 你的环境,看是否有:

selenium 
selenium
-client
selenium
-webdriver

如果没有请使用gem install 安装缺失模块。(可能只需要selenium-client 以及selenium)

2. 确认模块已安装后,编辑features/support/env.rb,添加:

require 'selenium/client'

Capybara.default_driver
= :selenium
Capybara.server_boot_timeout
= 50

3. 启动selenium:

bash$ selenium

4. 运行测试:

bash$ cucumber

一切正常的话应可看到selenium启动firefox并运行测试步骤。

热门下载

更多