Witam!
Mam problem z odpaleniem najprostszego testu selenium (narzędzie instalowane typowo: “gem install Selenium selenium-client”):
[code=ruby]require ‘spec_helper’
describe “Untitled” do
attr_reader :selenium_driver
alias :page :selenium_driver
before(:all) do
@verification_errors = []
@selenium_driver = Selenium::Client::Driver.new
:host => “localhost”,
:port => 4444,
:browser => “*firefox”,
:url => “http://localhost:3001/”,
:timeout_in_second => 60
end
before(:each) do
@selenium_driver.start_new_browser_session
end
append_after(:each) do
@selenium_driver.close_current_browser_session
@verification_errors.should == []
end
it “test_untitled” do
true.should be_true
end
end[/code]
spec_helper.rb:
code=ruby gem “selenium-client”
require “selenium/client”
require “selenium/rspec/spec_helper” (…)[/code]
I błąd: [~/Projekty/Eris]> rake spec:integration
(in /home/sebcioz/Projekty/Eris)
WARNING: Could not retrieve remote control logs: undefined method `closed?' for nil:NilClass
WARNING: Could not capture system screenshot: undefined method `closed?' for nil:NilClass
F
1)
NoMethodError in 'Untitled test_untitled'
undefined method `closed?' for nil:NilClass
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/protocol.rb:89:in `http_post'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/protocol.rb:12:in `remote_control_command'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/protocol.rb:11:in `remote_control_command'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/protocol.rb:19:in `string_command'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/base.rb:85:in `start_new_browser_session'
./spec/integration/admin_spec.rb:18:
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/rspec/rspec_extensions.rb:38:in `execute'
/var/lib/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/rspec/rspec_extensions.rb:36:in `execute'
Finished in 0.022898 seconds
1 example, 1 failure
rake aborted!
Command /usr/bin/ruby1.8 -I"lib" "/var/lib/gems/1.8/gems/rspec-1.3.0/bin/spec" "spec/integration/admin_spec.rb" --options "/home/sebcioz/Projekty/Eris/spec/spec.opts" failed
(See full trace by running task with --trace)
[~/Projekty/Eris]>
Pozdrawiam,
sebcioz