cucumber

Assocating BDD Scenarios with results of Silverlight Tests

I work with a team that uses Behaviour Driven Development(BDD) to deliver our applications. We have started delivering Silverlight applications. I would like to associate the agreed BDD Scenarios written in plain text to the results of the automated tests for our silverlight application. So when a scenario is met in the application th...

Reuse cucumber steps

I want to reuse some cucumber steps but can't seem to find the right way. I want to write a step like: Given /^I login with (.*) credentials$/ |type| # do stuff with type being one of "invalid" or "valid" end But then have another step like: Given /^I login successfully$ # call "Given I login with valid credentials" end So in ...

How to get cucumber to run the same steps against Selenium and a headless browser

I've been doing some work testing web applications with Cucumber and I currently have a number of steps set up to run with Culerity. This works well, but there are times when it would be nice to run the exact same stories in Selenium. I see two possible approaches that may work: Writing each step so that it performs the step approp...

Best Practices/Ideas for setting up system state when integration testing?

I have a number of C# integration tests written using the Given/When/Then style popularized by cucumber. I'm using a framework which basically works the same as NBehave. A recurring issue I'm facing is the issue of setup and wiring up all the application state necessary for the integration test. Most of my tests look something like this...

Cucumber + selenium fails randomly.

My selenium tests like to fails randomly. As an example I have this scenario Scenario: I should be able to edit a user Given I created a user with the login "[email protected]" And I am viewing the user with login "[email protected]" Then I should see "Edit this user" When I click "Edit this user" Then I should be editing the us...

Rspec integration tests without cucumber?

Is there a way to do integration tests with Rspec without using Cucumber? I prefer using just plain old Webrat. Thanks. ...

Cucumber alternative for .NET

Quick one, has anyone come across a library similar to Ruby's cucumber (a human readable DSL for defining use case stories that can be tested against) in the .NET sphere? ...

Cucumber: Access current controller instance within step definitions

I'd like to access the controller instance in my cucumber step definitions. The purpose of this is so I can manipulate http cookie and session values. I'm pretty sure there's a way to do this via World, but I'm not sure how. In regards to Ryan's comment, I'm writing a feature for a page which requires a logged in user (via Authlogic)....

How to test a rails model that accepts nested attributes with Cucumber

How do you test a model Topic that accepts nested attributes for an Image? Given /^I have topics titled (.+)$/ do |titles| path ="#{RAILS_ROOT}/features/upload-files/" image = File.new(path + "image.jpg") titles.split(', ').each do |title| Topic.create!(:title => title, :image => File.new(image) ) # this doesn't work! ...

Using cucumber and Rspec to develop a SOAP client with BDD

As a learning experience I'm developing a small Rails application that is supposed to query an existing SOAP API/web service (using the handsoap gem) and will simply present the information gathered there to a user. I like using rspec and am getting used to cucumber for testing my applications. The part that has me stumped is how to tes...

Missing record in Rails Testing

I'm trying to test Rails' Javascript with Cucumber/celerity and factorygirl. The stack itself works, but database is going crazy. I'm running mongrel on 3001 port (tried in both cucumber and test environments) and access it from cucumber via celerity. One of my tests looks following: create item 1 item exists do smth with item it w...

Rails cucumber problem

Seems like cuke doesn't show the full error message (at least when problem occurs in template) which makes it really hard to locate the problem. Here is what it outputs on some error: ... And I am on checkout page # features/step_definitions/webrat_steps.rb:6 You have a nil object when you ...

How do you develop outside-in Rails app using Cucumber & RSpec?

I just get started using BDD in Rails application, but I'm not sure what are best practices and workflows? And what other things that I really need for testing for my project such as step definitions, controllers, models, and views? Do I need to test all of those? ...

How to insert predictable IDs for testing using ActiveRecord

I am trying to do some Cucumber testing like the following: Given I am logged in as admin When I go to the article page Then I should see "Edit Article" And I should see "Article Title" where the path to the article page is "articles/1" or some known id.The problem is that when I insert my data using my step definition Article.create...

ActiveRecord dependency with Ruby, Rails, Cucumber, & RSpec

We are writing a Rails application that is using CouchDB as its data store. We're BDD/TDD'ing with RSpec and Cucumber, which is using WebRat for webpage testing I'm trying to remove ActiveRecord as one of the resources that is being loaded by rails but its causing the cucumber tests to fail. I've removed all references that I can find...

How do I get the response returned from Rack in a Cucumber step?

I have a Cucumber step for my Rails application: Then /^I should be redirected to the sign in page$/ do assert_equal 302, @response.status end But that @response object is the one returned by my Controller, and it's the Rack middleware that sets the status to what I expect it to be. How can I get at the response as returned from th...

Cucumber: Automatic step file creation?

When i run cucumber it displays the possible steps that i should define, an example from the RSpec book: 1 scenario (1 undefined) 4 steps (4 undefined) 0m0.001s You can implement step definitions for undefined steps with these snippets: Given /^I am not yet playing$/ do pending end When /^I start a new game$/ do pending end Then /^t...

Getting Cucumber & Subdomain-fu to play nice together

Hi all, I've recently started using Cucumber & Subdomain-fu together, and it's made me do some terrible things. I have a step definition that used to look like this: path = grok_path(path) get path That's nice and easy, in my opinion. But now it's this: path = grok_path(path) get "http://#{subdomain}.example.com#{path}" This wor...

How can I determine if a radio button is checked already?

I'm using webrat with cucumber and I would like to test if a radio button is checked already when I am on a page. How can I do that ? I didn't find any step in webrat which can do that. ...

RoutingError problems with Webrat

I'm currently rewriting a website in Rails. I've written a model that maps the old static URLs to the new ones and in the application controller I'm trapping RoutingErrors to call a method that looks for a new URL that maps to the old one. This works perfectly well in the applicaion itself; if I visit http://localhost:3000/home.htm it wi...