2010-09-17 23:56:32 +00:00
|
|
|
require 'spec_helper'
|
2009-11-14 09:44:46 +00:00
|
|
|
|
2012-07-21 20:44:10 +00:00
|
|
|
Capybara::SpecHelper.run_specs TestSessions::Selenium, "selenium", :skip => [
|
|
|
|
:response_headers,
|
|
|
|
:status_code,
|
|
|
|
:source,
|
|
|
|
:trigger
|
|
|
|
]
|
|
|
|
|
2009-11-16 21:02:16 +00:00
|
|
|
describe Capybara::Session do
|
2009-11-14 09:44:46 +00:00
|
|
|
context 'with selenium driver' do
|
|
|
|
before do
|
2010-09-07 16:16:19 +00:00
|
|
|
@session = TestSessions::Selenium
|
2009-11-14 09:44:46 +00:00
|
|
|
end
|
2009-12-11 21:40:23 +00:00
|
|
|
|
2009-11-14 09:44:46 +00:00
|
|
|
describe '#driver' do
|
2009-12-11 21:40:23 +00:00
|
|
|
it "should be a selenium driver" do
|
2011-04-11 05:24:00 +00:00
|
|
|
@session.driver.should be_an_instance_of(Capybara::Selenium::Driver)
|
2009-11-14 09:44:46 +00:00
|
|
|
end
|
|
|
|
end
|
2009-12-11 21:40:23 +00:00
|
|
|
|
2009-11-14 09:44:46 +00:00
|
|
|
describe '#mode' do
|
|
|
|
it "should remember the mode" do
|
|
|
|
@session.mode.should == :selenium
|
|
|
|
end
|
|
|
|
end
|
2009-12-11 21:40:23 +00:00
|
|
|
|
2012-07-13 11:15:44 +00:00
|
|
|
describe "exit codes" do
|
|
|
|
before do
|
|
|
|
@current_dir = Dir.getwd
|
2012-07-13 11:28:33 +00:00
|
|
|
Dir.chdir(File.join(File.dirname(__FILE__), '..'))
|
2012-07-13 11:15:44 +00:00
|
|
|
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
|
2009-11-14 09:44:46 +00:00
|
|
|
end
|
|
|
|
end
|