bdd

Gherkin Scenarios for User Input Validation

When writing a BDD scenario that is validating information on an input form, how would you list rules. Options are: 1) A single scenario each rule 2) Scenario outline with examples for each field and rule How do we say something is invalid that is not in a certain character set, e.g: Given I enter a value that breaks the rule.. When ...

Cucumber and Silverlight 4

So I am wondering if anyone is familiar or has done any work with cucumber and Silverlight. I currently have a template directory and build file that will create RSpec tests using Bacon (light weight RSpec). I have been looking into SpecFlow and Cuke2Nuke but almost everything I have seen works with general .net code not silverlight co...

Refactoring Rspec specs

I am trying to cleanup my specs as they are becoming extremely repetitive. I have the following spec describe "Countries API" do it "should render a country list" do co1 = Factory(:country) co2 = Factory(:country) result = invoke :GetCountryList, "empty_auth" result.should be_an_instance_of(Api::GetCount...

BDD in WPF/.NET

Hi there, I've just found Swinger (http://github.com/demetriusnunes/swinger) and I was wondering: is there something like this for WPF? ...

How do I setup and utilize Shoulda, Factory_Girl, and Cucumber in a Rails 3 application?

I'm able to get my Gemfile how I like it: # Gemfile source "http://gemcutter.org" gem "rails", :git => "git://github.com/rails/rails.git" git "git://github.com/rails/arel.git" git "git://github.com/rails/rack.git" gem "sqlite3-ruby" group :test do gem "shoulda", :git => "git://github.com/thoughtbot/shoulda.git", :branch => ...

How can I test a form that requires the entry of two random characters from a security phrase?

I need to test a two-stage login system which first asks for your email address and password and then presents the user with two select lists containing [a-zA-Z0-9]. The labels beside the drop down's are of the form 'Select character X from your security phrase', where X is a random character index from a known security phrase. I'd rath...

DRY-ing very similar specs for ASP.NET MVC controller action with MSpec (BDD guidelines)

Hi all, I have two very similar specs for two very similar controller actions: VoteUp(int id) and VoteDown(int id). These methods allow a user to vote a post up or down; kinda like the vote up/down functionality for StackOverflow questions. The specs are: VoteDown: [Subject(typeof(SomeController))] public class When_user_clicks_the_vo...

Testing ActionFilterAttributes with MSpec

I'm currently trying to grasp MSpec, mainly to learn new ways of (T/B)DD to be able to make an educated decision on which technology to use. Previously, I've mostly (read: only) used the built-in MSTest framework with Moq, so BDD is quite new for me. I'm writing an ASP.NET MVC app, and I want to implement PRG. Last time I did this, I us...

How do I get SpecFlow to expect an exception?

I'm using SpecFlow, and I'd like to write a scenario such as the following: Scenario: Pressing add with an empty stack throws an exception Given I have entered nothing into the calculator When I press add Then it should throw an exception It's calculator.Add() that's going to throw an exception, so how do I handle this in ...

Getting spree cart to play nicely with rspec & cucumber

Just setting up spree and wondering how best to setup the project so I can use cucumber and rspec. Thanks evolve ...

Any suggestions for improvement on this style for BDD/TDD?

I was tinkering with doing the setups with our unit test specifciations which go like Specification for SUT when behaviour X happens in scenario Y Given that this thing And also this other thing When I do X... Then It should do ... And It should also do ... I wrapped each of the steps of the GivenThat in Actions... any f...

Cucumber : Size of features

Im new to testing with cucumber and have a question regarding the size of a 'Feature'. Assume you can add a collection of items to a list and do the usual CRUD , is it preferred to create one feature for this complete set of CRUD actions or a feature for each? What is the preferred/accepted method ? At what point does an action become...

How to get Gherkin syntax highlighting for .feature files in Visual Studio?

There's no highlighting for Feature, Scenario, Given, When, Then, etc. keywords by default. Is there a ready made template out there to enable this? ...

How to mock/stub a directory of files and their contents using RSpec?

A while ago I asked "How to test obtaining a list of files within a directory using RSpec?" and although I got a couple of useful answers, I'm still stuck, hence a new question with some more detail about what I'm trying to do. I'm writing my first RubyGem. It has a module that contains a class method that returns an array containing a ...

How to run SpecFlow tests in Visual Studio 2010?

Trying to get SpecFlow running with a fresh VS2010 Professional install. Created a new console application and added references to NUnit and SpecFlow. Created a SpecFlow feature. The .feature with the default template code is created. Now I try to run this test, but I don't understand how. When I right-click the project (at the top-lev...

How to assert on number of html table rows in ruby using capybara + cucumber

I am trying to get to grips with BDD web development in Ruby using cucumber + capybara and I am stuck at what should be an easy task - just to check the number of rows in a table. The intention of what I'm trying to achieve is something along the lines of: page.should have_xpath("//table[@id='myTable']") find("//table[@id='myTable']/tr"...

Feature-level behavior testing tools for Java/Scala

Is there a Java or Scala equivalent to Cucumber/SpecFlow? One possibility is using Cucumber with JRuby; any others? ...

Using custom Selenium server on capybara

I'm trying to use capybara and Selenium but with custom server for Selenium, for example I want to route the server to saucelabs.com, is anyone here are have try it before? Thanks b4 ...

BDD / TDD with JSpec - Removing code duplication

How do I refactor to remove the code duplication in this spec: describe 'TestPlugins' describe '.MovieScanner(document)' before_each MoviePage_loggedIn = fixture("movie_logged_in.html") // Get logged-in movie page MoviePage_notloggedIn = fixture("movie_not_logged_in.html") // Get no...

How to properly create features, tests, stories and break them down.

I am trying to grasp the entire TDD methodology and as such, I don’t really know how to present this as a nice concise question so here is the long drawn out version. I seem to be experiencing a gap between the bowling (Martin), money (Feathers), and other similar game/simple examples and a fully functioning Enterprise app. I am trying ...