Sha256: 03c45a7439c4a5bb55e4a391bb7b93798ae26be6929d092e948e87372a03bf1b

Contents?: true

Size: 1.52 KB

Versions: 15

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'
require 'rbconfig'

describe Capybara::Selenium::Driver do
  before do
    @driver = TestSessions::Selenium.driver
  end

  it_should_behave_like "driver"
  it_should_behave_like "driver with javascript support"
  it_should_behave_like "driver with resynchronization support"
  it_should_behave_like "driver with frame support"
  it_should_behave_like "driver with support for window switching"
  it_should_behave_like "driver without status code support"
  it_should_behave_like "driver with cookies support"

  unless Config::CONFIG['host_os'] =~ /mswin|mingw/
    it "should not interfere with forking child processes" do
      # Launch a browser, which registers the at_exit hook
      browser = Capybara::Selenium::Driver.new(TestApp).browser

      # Fork an unrelated child process. This should not run the code in the at_exit hook.
      pid = fork { "child" }
      Process.wait2(pid)[1].exitstatus.should == 0

      browser.quit
    end
  end

  describe "exit codes" do
    before do
      @current_dir = Dir.getwd
      Dir.chdir(File.join(File.dirname(__FILE__), '..', '..'))
    end

    after do
      Dir.chdir(@current_dir)
    end

    it "should have return code 1 when running selenium_driver_rspec_failure.rb" do
      `rspec spec/fixtures/selenium_driver_rspec_failure.rb`
      $?.exitstatus.should be 1
    end

    it "should have return code 0 when running selenium_driver_rspec_success.rb" do
      `rspec spec/fixtures/selenium_driver_rspec_success.rb`
      $?.exitstatus.should be 0
    end
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
nimboids-capybara-1.1.2 spec/driver/selenium_driver_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/driver/selenium_driver_spec.rb
capybara-1.1.2 spec/driver/selenium_driver_spec.rb
capybara-1.1.1 spec/driver/selenium_driver_spec.rb
capybara-1.1.0 spec/driver/selenium_driver_spec.rb
capybara-1.1.0.rc1 spec/driver/selenium_driver_spec.rb