cucumber

Invalid date when installing cucumber on Ruby 1.8.6

I'm setting up a continuous integration server for an application that uses cucumber. I'm trying to install cucumber gem on ubuntu linux 10.04 but it doesn't work on ruby 1.8.6. It works on ruby 1.8.7 but it doesn't solve my problem because cruisecontrolrb demands 1.8.6. I have found this link http://www.ruby-forum.com/topic/198581, and ...

Cucumber and Capybara, clicking a non-link or button element

I am trying to test an inplace editor using Cucumber/Capybara/Selenium stack, but my problem is that the editor is activated by clicking a div and not a link or button. I can not seem to figure out how to get Capybara to do this. Is there a way of doing this? ...

Undefined local variable or method `_setup_mocks' in cucumber 0.8.5 and rspec2

Inside of : features/support/env.rb require 'cucumber/rspec/doubles' I just ported my project to a new cpu and it's returning this error on everything: undefined local variable or method `_setup_mocks' I'm guessing I'm missing something. Gems : rspec (2.0.0.beta.18) rspec-core (2.0.0.beta.18) rspec-expectations (2.0.0.beta.18) rs...

mysql timeout error in rails 3 when using delete_all and make! in step definition

I'm using following construct in a cucumber step definition. Given "I have following stuff" do Model.delete_all list.each { |i| Model.make!(:name => i) } end (make! is from machinist 2). Above step fails with INSERT statement timeout. When I open up a console for test, environment, I can execute each statement without an issu...

has anyone had any success trying to use cucumber with non english speaking people writing stories?

i like cucmber stories. they just look great. I am trying to find a way to use them in my daily work as a projet manager / developer / tester / analyst (you name it :p). problem ? my clients speak french only. No english. i see that cucumber seems to support 40 languages (wow!) => http://wiki.github.com/aslakhellesoy/cucumber/spoken-la...

Is there a way to detect that I'm in a Selenium Webdriver page from Javascript

I'd like to suppress the initialization of TinyMCE inside my tests and can do this easily if the Javascript can detect that I'm running inside a Selenium-automated page. So, is there some JS code that I can use to detect the Selenium driver? Alternatively, how can I extend the userAgent string to include a pattern that I can detect from...

Running a login step prior to scenario outline in cucumber

I'm using cucumber with webrat/mechanize to test a PHP site and I'm trying to improve the speed the tests run by avoiding running unnecessary steps. I want to use a scenario outline to check a whole lot of pages are accessible/protected depending on the user who is logged in: Scenario Outline: Check page access is secure Given I am l...

Check select box has certain options with Webrat

How do I use Webrat to check that a select box has certain values listed as options? I currently have field_named(field).value.should contain(value) but that only passes for the first selected value and not for the unselected values. How do I check that the unselected options are present? And how do I check the number of options avail...

Cucumber and Images

I got a problem with Cucumber. I don't know kow to say to Cucumber that "he" has to click on a picture and then see some text...like I do with buttons or links. When I click on a picture, I have to see the text "USER OK" in the screen. How can I do that? ...

Cucumber,Capybara and ElementNotFound

In my rails application, I have a page with a link that execute a javascript function : <%= link_to_function("Add an address", "add_fields(this)".html_safe) %> In my cucumber feature I have : And I press "Add an address" And the message I get is : Capybara::ElementNotFound: no button with value or id or text 'Add an address' fou...

ruby 1.9.2 strange warning when running cucumber specs

Hi, I just updated to use rails 3 and tried my first project with rails 3. When I run my cucumber specs then I get following strange warnings /home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string /home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/uti...

How to follow redirect from javascript in cucumber?

I have a a button (not a submit button) which does ajax calls before submitting another form. What I want to do is Given I am viewing homepage When I press "JustAButton" Then I should be on "/users/home" But the redirection happens somewhat late and "Then" statement fails considering that the page is still in homepage. How can I wait...

Log-in through authlogic without having to fill in form every time

I have a number of Cucumber scenarios which run with capybara on a project I am working on. Most of these scenarios start with a "Given I am logged in" step. Currently my implementation of this is: visit path_to('the login page') fill_in('Username', :with => 'user') fill_in('Password', :with => 'password') click_button('Login')...

How can I test streamed data with Webrat?

I have code for streaming a CSV similar to the following in a controller: def download filename = 'data.csv' headers.merge!( 'Content-Type' => 'text/csv', 'Content-Disposition' => "attachment; filename=\"#{filename}\"", 'Content-Transfer-Encoding' => 'binary') render :status => 200, :text => Proc.new { |response, outp...

Cucumber/Webrat not following the redirect_to

I am running rails 3.0.0, rspec-rails 2.0.0.beta.20, webrat 0.7.2.beta.1, cucumber-rails 0.3.2 I have this scenario: Scenario: Given I am on the new account page And I fill in "Name" with "John Doe" When I press "Create" Then I should be on the access page When I run it I get: expected: "/access", got: "/accounts" Like its ...

cucumber should see button

I have a form that has this <%= submit_tag 'Search Event' %> and a cucumber step that says And I should see "Search Event" but this step fails.. why is that? Here is the error i get expected #has_content?("Search Event") to return true, got false (RSpec::Expectations::ExpectationNotMetError) ...

How to solve a Capybara::ElementNotFound Error

Hi, I'm stuck with the following problem, this is the first time I use capybara, have you an idea how I can solve this issue, thanks I use rails 3.0.0 and the following gems gem 'rails', '3.0.0' gem 'capybara' gem 'database_cleaner' gem 'cucumber-rails' gem 'cucumber' gem 'rspec-rails' gem 'spork' gem 'launchy' I have the following ...

Cucumber & webrat, selecting from a radio button list

I'm trying to get webrat to select a radio button from a list, using cucumber. I have this scenario: Scenario: Update an existing article Given I have an article with title Big Bananas and body text Big yellow bananas are good for you And I am on the list of articles When I choose "Big Bananas" And press "Update article...

How to test email validation with cucumber

Hi, I'm wondering how to write a cucumber feature and spec to check the following validation Field email, here is the validation in the model validates :email, :presence => true, :length => {:minimum => 3, :maximum => 254}, :uniqueness => true, :format => {:with => /^([^@\s]+)@((...

Cucumber parse speed

We have been using Cucumber for some time now, and now have over 200 scenarios. Our startup speed is getting very slow, which makes a big difference in our edit-test-commit cycle. The problem seems to be the parsing of the feature files. Is there a way we can speed this up? NOTE: We are using IronRuby, which has a known slow startup tim...