cucumber

Data-driven tests in Cucumber

I've got to test a message-routing application, whose functionality is broadly as follows: - message gets sent to app - app examines message - message gets forwarded somewhere, based on the content of the message The vast majority of test cases are near-identical; generate a particular type of message, load it into the system, wait a fe...

Cucumber + Webrat + Selenium guide

Hello, I have been using Cucumber and Webrat for a while. I know need to start writing behaviour that involve AJAX interactions so I was thinking to use the Selenium adapter for Webrat. Can anyone point out a easy and updated step-by-step guide for installing and configuring selenium+webrat+cucumber? I would like to be able to mix javas...

How to integrate Cucumber into Code to Test Ratio?

When I use "rake stats" I can get to know how many lines of code I have written for my RSpec tests. And my RSpec tests influences also the Code to Test Ratio. But can I list my lines of code from the Cucumber steps there, too? Best regards ...

How to mock/stub a model in Cucumber tests

The scenario is as follows. My Order model has an after_create that contacts a remote payment gateway to retrieve a payment URL. In my Cucumber tests I don't want to perform this action, but return an arbitrary URL. My current cucumber tests looks like this: Given there is a product "Product X" When I enter my credentials And I cl...

undefined method 'bin_path' error on invoking cucumber with ironruby

Just riding on the BDD wave for the past 2 days.. I was intrigued with Aslak Hellesoy's InfoQ video on RSpec. Specifically with the language agnostic integration testing framework claims.. SO I was looking at testing a .Net app with Cucumber which seems to be the latest avatar of the BDD story runner. Followed the examples on cukes.info...

Cucumber for PHP application

Is it possible to use Cucumber outside Rails? I'd like to start using it for testing some of my PHP applications, but I really don't know how to start. Probably the easiest way would be creating a Rails project only to run Cucumber features, but that seems like to me as overkill. What is the simplest way to set up Cucumber for testing ...

Edge Rails doesn't list plugin/gem generators

I recently created a project skeleton with Edge Rails and installed rspec, rspec-rails and cucumber as plugins (git submodules). If I run: $ script/generate all I get is a list of built-in generators. The ones from the plugins don't show up. I installed the same plugins as gems and got the same result. Does anyone know why this is hap...

How can I test a flash application?

I have a swf file that should execute network calls when the user clicks on various stuff in it (and then do certain things based on the results of the calls). What's my best option for automatically running tests to make sure that the flash application is behaving correctly? This is with ActionScript 8, btw. Not Flex. I'm experience...

session[] doesn't persist across cucumber steps

Every time this step Given /blah.../ ... cart = session[:cart] ||= Cart.new ... end runs in a scenario, it creates a new cart as opposed to (starting from the second call) picking one up from the session. Anyone knows how to fix that? I am on rails 2.2.2, cucumber 0.3.98, webrat 0.4.4 P.S. Possibly adding selenium into ...

Cucumber BeforeStep

Is there a BeforeStep equivalent to AfterStep in Cucumber? If not - has anyone found a solution / workaround? ...

How to test chat application in Ruby on Rails?

What would be the best way to implement integration test for chat application? The problem is that I don't know how to implement two user behavior without stubbing and mocking everything. How would you implement these steps? Given I have two users "joe" and "bob" logged in When "joe" send "Hello!" message to "bob" Then "bob" should ...

Snow Leopard + cucumber/webrat/rspec

Since I've upgraded to snow leopard I've been having tons of problems using cucumber to run my features. Currently, every time I run cucumber I get the following error. Missing these required gems: webrat cucumber >= 0.3.100 webrat >= 0.5.0 rspec >= 1.2.6 rspec-rails >= 1.2.6 You're running: ruby 1.9.1.243 at /...

What's the main difference between cucumber and shoulda?

How would you make a decision between cucumber and shoulda if you were about to choose a testing framework? What differentiates these two frameworks primarily? ...

How do I make Cucumber and RMagick play nice on Snow Leopard?

I installed Snow Leopard and things have been going great, after a few re-installs. But now when I go to run cucumber, I get the error below, and I can't find anything conclusive through Google searches. Has anyone run into this, or maybe have some troubleshooting steps to try? $ cucumber features dyld: NSLinkModule() error dyld: Libr...

Rails Cucumber Testing With a LDAP Server

I am trying to write some cucumber tests for my application that uses Authlogic for authentication, but actually stores users in a LDAP server. The application seems to work fine, but where I am running into trouble is writing tests for it (I know, I know, I should've wrote the tests first.) It's easy to have a test database where the d...

How to create integration level test for two user interaction?

How would you test multi user interaction with Cucumber/webrat? Meaning that there must be more than one user logged in. Good example would be simple chat application, where I want to send message from one user to another and check if the other user received the message. I'd like to test at integration level, without any stubbing or m...

How do I check that a form is pre-populated with values using Cucumber and Webrat?

I am learning Cucumber and Webrat with Rails and would like some advice on the best way to test an "edit" form. When I browse to a user's profile I am presented with an edit form with the user's information pre-populated in the form fields. I would like to be able to test that the fields do in fact contain the information I expect. Here'...

Finding a label with Webrat that contains a link

So I'm doing BDD with Cucumber and have a form with checkboxes populated from a database. The labels for the checkboxes contain hyperlinks. So far, not too exotic (note, this is HAML and not Erb, but it should be readable enough for any Rails person): I would like my donation to support: %br - for podcast in @podcasts = check_box_ta...

Type Error running feature in Rail's Cucumber

I'm trying to run Cucumber for my Rails application and keep getting this error: > superclass mismatch for class Point (TypeError) There's a huge stack trace from this error, but it does not point to anything specific except a missing requirement. Here's the trace: rake features (in /Users/rob/blue/blue_web) /System/Library/F...

Mocha + Cucumber to mock the Net response

The following is the app/models/websites.rb class Masterpiece < ActiveRecord::Base validates_presence_of :title, :link validates_uri_existence_of :link, :allow_redirect => false end The second validation is from the plugin Validates Existence of URI plugin The following is the features/support/mocha.rb file require 'mocha' W...