Feature: Baidu Search
As a casual internet user
I want to find some information about watir, and do a quick conversion
So that I can be knowledgeable being
Scenario Outline: Baidu Search
Given that user goto baidu page
When that user search for "<word>"
Then that user see the watir result
Examples:
| word |
| watir |
| test |
require 'watir'
require 'rspec'
Given /^that user goto baidu page$/ do
ie.goto "www.baidu.com"
end
When /^that user search for watir$/ do
ie.text_field(:name,'wd').set 'Watir'
end
When /^that user search for "([^"]*)"$/ do |arg1|
ie.text_field(:name,'wd').set (arg1)
end
Then /^that user see the watir$/ do
ie.html.include?("watir").should == true
end
Then /^that user failed to see watir$/ do
ie.html.include?("esdsds").should == false
end作者: 奔雷 时间: 2012-5-21 15:58
我也在用 cucumber selenium-webdriver ruby jenkins,欢迎交流。@Given_When_Then 新浪微博 作者: dugang 时间: 2016-8-16 15:54
cucumber BDD采用自然语言描述自动化用例。
比较适合没有代码开发经验的测试人员使用。