Skip to content

Modern Gherkin-based BDD framework for .NET ecosystem

License

Notifications You must be signed in to change notification settings

Romfos/NGherkin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Modern Gherkin-based BDD framework for .NET ecosystem

.github/workflows/build.yml

NGherkin
NGherkin.TestAdapter

Requirements

  • NET 6+ (recommended) or .NET Framework 4.6.2+
  • Visual Studio 2022 or Visual Studio Code or any other editor with .NET support

Optional: gherking syntax plugin for your code editor:

  1. Reqnroll plugin for Visual Studio 2022
  2. Cucumber plugin for Visual Studio Code or any other plugin

How to use

  1. Create new class library for .NET 6+ or .NET Framework 4.6.2+
  2. Add following nuget packages:
  1. Create startup class and register dependencies. Example:
public sealed class Startup : StartupBase
{
    public override void Configure(IServiceCollection services)
    {
        services.AddGherkinFeatures();
        services.AddGherkinSteps();
    }
}
  1. Add feature files
  2. Add classes with steps. Example:
[Steps]
internal sealed class StepClass
{
    [Given("given1")]
    public void Given()
    {
    }

    [When("this is when step with '(.*)' argument an '(.*)' argument")]
    public void When1(int arg1, string arg2, DataTable dataTable)
    {
    }

    [Then("then1")]
    public void Then1()
    {
    }
}