cucumber

How to test/spec Sinatra & MongoDB API with Cucumber?

I want to spec a Sinatra server that receives HTTP requests, stores things in MongoDB, and responds with JSON. How would I spec both the MongoDB entries and the responses? I'd like to use Cucmber and RSpec to do this cause I hear they're hot, but I'm not really good with them yet. Thanks! Matt ...

Cucumber IDE for feature writing with autocomplete?

Hi, Is there any Eclipse plugin for writing features for cucumber with autocomplete functionality? I guess that would be good to find and reuse steps from other features. Any ideas? ...

How to use Cucumber to test content loaded with javascript

I've been developing a Rails application and I've decided to implement a mixture of Test Driven Development and Behavioral Driven Development. However the application I am building uses a web application user interface framework known as MochaUI which is built on top of the Mootools framework. I have just finished writing a portion of...

How to make Cucumber step definitions load according to feature file being executed

Hi, I would like to modify cucumber so that when a given feature is being executed (say "login.feature") I want only login_steps.rb to be loaded for the web steps. Other step files should not be loaded. IMO this would be very useful to have the same steps but which differ in implementation work accordingly from the feature's name whic...

Cucumber/Capybara test no longer run in Rails 3 project.

Do the latest versions of these gems not work with each other any more? It appears that something may have gotten out of whack in my bundle. undefined local variable or method `node' for #<Capybara::Driver::RackTest::Node:0x103e19390> (NameError) ./features/step_definitions/web_steps.rb:35 ./features/step_definitions/web_steps.rb:14:in ...

Cucumber: Before hook run only once for all scenarios

I have a scenario outline with multiple scenarios. I'd like my Before hook to run only once so I can bootstrap the ActiveRecord objects I need to run against all of the scenarios. The problem is if I use Before do # my code here end This will execute before each Scenario. Is there anyway to run it once for the entire Outline? ...

If my "Then I should see" Cucumber feature is failing, how can I see what Cucumber is seeing?

Presumably if Cucumber is not seeing what I expect it to see, it must be seeing something else. Mirroring in my application what I think the same steps are, I get the desired output. This is a "signing in" feature. It appears that sign in is failing in the test. But unless I can see the error message, I don't know why it's failing! ...

Running integration tests with Cucumber/capybara/celerity on a Jruby on Rails application using mysql

I've got an application I've been working on with ruby 1.9.1. I'd like to test the javascript in my UI and the default selenium driver for capybara doesn't support the events I need to test. So I'm going through the process of using rvm to switch the application on to jruby for testing, since apparently celertiy/culerity only work on j...

Behavior Driven Development and PHP applications

I am in love with Cucumber. It's easily configured for a Ruby on Rails application. However, I'm new to Ruby and so is the rest of my team. We are writing PHP applications using the Zend Framework. I'm interested in hearing how you have implemented BDD for your PHP applications and what frameworks/libraries I should use. Have you configu...

What are spec/requests good for?

I use RSpec to test my lovely little web app. For integration tests I use Steak. When using Rails generators (yep, I know that this is not the Zen way of doing TDD) there are also some files in spec/requests generated. As stated on link text it is something similiar to integration test (but I couldn't find much more info). Are those req...

Integration vs acceptance test ... what is Cucumber / Steak ?

For integration tests of my Rails web app I use Steak (something like Cucumber). The specs of Steak are in a folder named spec/acceptance. Are Steak/Cucumber now for integration or acceptance testing? I always thought that this is something different. ...

How to pass YML-like data struct to scenario of cucumber ?

I want to pass YML-like config data to the scenario of cucumber. for instance: category: subcategory: name: whay how to do this? thanks ...

Cucumber: Events should be listed in chronological order by event date

This cucumber-test wont fail even if I replace the order of the events. It should only pass if the order is in the chronological by event date. But its passes in whatever order i put the table in. What can the problem be? Scenario: Events should be listed in chronological order by event date Given I am signed into an account called "Gor...

Cucumber: undefined step, although step should be defined

I have created the step: Given /^the feed "([^"]*)" has an item "([^"]*)" published at "([^"]*)"$/ do |feed_name, feed_item_title, published_at| feed = Feed.find_by_name(feed_name) FeedItem.make(:feed => feed, :title => feed_item_title, :published_at => published_at) end And I run the cucumber test with: Scenario: feed items ...

Issues with using subdomains with Cucumber/Capybara

I have successfully added the ability to use dynamic subdomains within my application. The issue is that when I run my Cucumber tests, I receive the following error when my application performs a redirect_to which contains a subdomain: features/step_definitions/web_steps.rb:27 the scheme http does not accept registry part: test_url.exam...

Does Capybara require JRuby?

I'm building a Rails 3 app. I'm trying to learn Cucumber with Capybara. Do I need JRuby to run Capybara via Cucumber? I've used Webrat, but many people seem to be using Capybara, so I'd love to try. I don't need JavaScript testing right away, but I want to install Capybara if I need in the end. I read and read the Capybara document...

Cucumber Scenario: Should be listed in chronological order by date in ASC order

Scenario: Events should be listed in chronological order by event date in ASC order How do i test this scenario in cucumber? Events has a name and a event_date. Events is shown in a list in the GUI. I want the test to fail when the events is in a unsorted order and the test to pass when the list is sorted by event_date ASC order. Th...

How to reuse Cucumber step definition with a table for the last parameter?

This code: Then %{I should see the following data in the "Feeds" data grid: | Name | | #{name} |} And this one: Then "I should see the following data in the \"Feeds\" data grid: | Name | | #{name} |" And this: Then "I ...

Matching input tag with Cucumber/Webrat

I'm learning Cucumber, but I can't make a step for just matching input tags. What I have in the view is <input type="submit" value="Press!" /> And what I tried in Cucumber are Then the "input" field should contain "Press!" Then the "type" field should contain "submit" I just wanna confirm the existence for the input tags with cert...

How to write integration tests for background workers

I am building something similar to BBC Zeitgeist. Basically it's a series of workers passing jobs to each other. If I'm doing this by hand, here's what I'll do: Setup some parameters Run the workers Start the initial worker Wait for the workers to do their jobs Test the outcome For the background job workers, I'm using Resque. I'...