0

我的 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

测试未运行,未显示错误

4

1 回答 1

1

改名:

test/selenium/test1.rb

至:

test/selenium/test1_spec.rb
于 2013-05-21T07:16:41.840 回答