私の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
テストは実行されていません。エラーは表示されません