0

My rakefile selenium task doesn't run any tests and gives no error. My files:

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

test/selenium/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)

Result:

wtf

test is not running, no error is shown

1 Answer 1

1

Rename:

test/selenium/test1.rb

to:

test/selenium/test1_spec.rb
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.