我的 rakefile selenium 任务没有运行任何测试并且没有给出错误。我的文件:
Rakefile
desc 'Selenium test'
task :selenium => [:init] do
RSpec::Core::RakeTask.new() do |t|
t.pattern = 'test/selenium/*.rb'
t.verbose = true
end
print 'wtf'
end
测试/硒/test1.rb:
require "selenium-webdriver"
require "rspec"
include RSpec::Expectations
describe "Test" do
before(:each) do
@driver = Selenium::WebDriver.for "ie"
@base_url = "my site"
@driver.manage.timeouts.implicit_wait = 10
@verification_errors = []
@driver.get(@base_url)
end
after(:each) do
@driver.quit
@verification_errors.should == []
end
it "test_" do
#verify { element_present?(:link, "Edit campaign").should be_true }
verify { element_present?(:link, "Campaign list").should be_true }
(@driver.find_element(:link, "Campaign list").text).should == "Campaign list"
end
def element_present?(how, what)
结果:
wtf
测试未运行,未显示错误