Tuning with cucumber, capybara and selenium, but some scenarios work only randomly.
Launch
ruby 1.8.6 on rvm
rails 2.3.8
selenium pops open firefox 3.6
I tried adding this with no luck:
with_scope(selector) do click_button(button) selenium.wait_for_page_to_load end
Error output sometimes:
> Given I am logged in and have created newsletter and subscribers # features/step_definitions/newsletter_send_steps.rb:108 end of file reached (EOFError) /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/protocol.rb:133:in `sysread' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/timeout.rb:62:in `timeout' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/timeout.rb:93:in `timeout' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/protocol.rb:126:in `readline' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:2020:in `read_status_line' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:2009:in `read_new' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:1050:in `request_without_fakeweb' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:1037:in `request_without_fakeweb' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:543:in `start' /Users/christianhager/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/1.8/net/http.rb:1035:in `request_without_fakeweb' ./features/step_definitions/web_steps.rb:24:in `__instance_exec2' ./features/step_definitions/web_steps.rb:9:in `with_scope' ./features/step_definitions/web_steps.rb:9:in `with_scope' ./features/step_definitions/web_steps.rb:23:in `/^(?:|I )press "([^\"]*)"(?: within "([^\"]*)")?$/' features/enhanced/newsletter_send1.feature:7:in `Given I am logged in and have created newsletter and subscribers'
Once again:
> no button with value or id or text 'create_user_button' found (Capybara::ElementNotFound) ./features/step_definitions/web_steps.rb:24:in `__instance_exec2' ./features/step_definitions/web_steps.rb:9:in `with_scope' ./features/step_definitions/web_steps.rb:9:in `with_scope' ./features/step_definitions/web_steps.rb:23:in `/^(?:|I )press "([^\"]*)"(?: within "([^\"]*)")?$/' features/enhanced/newsletter_send1.feature:7:in `Given I am logged in and have created newsletter and subscribers'
And sometimes it just works ...
This is what my env.rb looks like
ENV["RAILS_ENV"] ||= "cucumber" require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') require 'cucumber/formatter/unicode'
Cucumber steps:
Given that I'm on the registration page
And I fill in "user_login" "jeppsipeppsi@arcticelvis.com" inside the "body"
And I fill "user_password" with the "secret" inside the "body"
And I fill "user_password_confirmation" with the "secret" inside the "body"
And I check the "terms_of_use" inside the "body"
And I click create_user_button inside the body
Any insight would be great :)
ruby selenium cucumber capybara
Christian
source share