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...
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 ...
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...
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...
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...
Is there a way to do integration tests with Rspec without using Cucumber? I prefer using just plain old Webrat. Thanks.
...
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?
...
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 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!
...
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...
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...
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 ...
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?
...
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...
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...
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...
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...
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...
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.
...
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...