Git Product home page Git Product logo

cucumberexpressions.specflow's Introduction

CucumberExpressions.SpecFlow

Cucumber expressions support for SpecFlow v3.1 (SpecFlow plugin).

Note: Cucumber expression support will be hopefully added to the core SpecFlow package in a future version. But for the current SpecFlow versions, it can be already used using this plugin.

With Cucumber expressions you can specify your step definitions in a simpler way.

Instead of using regular expressions:

[When(@"I add (\d+) copies of the book ""([^""])"" into my basket")]

Use Cucumber expressions:

[When("I add {int} copies of the book {string} into my basket")]

Installation

Just simply add the CucumberExpressions.SpecFlow.3-1 NuGet package to your SpecFlow v3.1 project!

PM> Install-Package CucumberExpressions.SpecFlow.3-1

Features

The plugin supports most of the features described in the Cucumber expressions documentation. You can use {int}, {float}, {word}, {string} and also the generic {} anonymous matching pattern. SpecFlow detects the parameter type of your method and performs the necessary conversation anyway.

You can also use the most common built-in types by (case sensitive) type name (without namespace): {Boolean}, {Byte}, {Int32}, {Decimal}, {Guid}, {DateTime}, etc.

The custom conversions can be used either with the anonymous parameter {} or with the target type name, like {Person}. To specify the conversion, you need to use the usual [StepArgumentTransformation] attribute:

[StepArgumentTransformation]
public Person ConvertPerson(string name)
{
  //...
}

Compatibility

It is mostly backwards compatible as it recognizes common regex patterns and uses regex mathching for them. If necessary you can force using the regex matcher by wrapping your pattern with ^ and $.

[When(@"^forced regex$")]

IDE Support

To be able to recognize Cucumber expression in your Visual Studio, the Visual Studio integration also has to be updated. Currently the Devreoom for SpecFlow (free, open-source) Visual Studio extension supports this new patterns.

cucumberexpressions.specflow's People

Contributors

gasparnagy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.