https://github.com/romfos/ngherkin
Modern Gherkin-based BDD framework for .NET ecosystem
https://github.com/romfos/ngherkin
bdd cucumber dotnet executable-specification gherkin spec test-automation-framework testing tests
Last synced: 2 months ago
JSON representation
Modern Gherkin-based BDD framework for .NET ecosystem
- Host: GitHub
- URL: https://github.com/romfos/ngherkin
- Owner: Romfos
- License: mit
- Created: 2023-12-06T22:38:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-20T16:21:35.000Z (6 months ago)
- Last Synced: 2025-01-10T21:42:52.979Z (4 months ago)
- Topics: bdd, cucumber, dotnet, executable-specification, gherkin, spec, test-automation-framework, testing, tests
- Language: C#
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
Modern Gherkin-based BDD framework for .NET ecosystem
[](https://github.com/Romfos/NGherkin/actions/workflows/build.yml)
[](https://www.nuget.org/packages/NGherkin)\
[](https://www.nuget.org/packages/NGherkin.TestAdapter)# Requirements
- NET 8+ (.NET 9 is recommended)
- Visual Studio 2022 or Visual Studio Code or any other editor with .NET supportOptional: gherking syntax plugin for your code editor:
1) [Reqnroll plugin](https://marketplace.visualstudio.com/items?itemName=Reqnroll.ReqnrollForVisualStudio2022) for Visual Studio 2022
2) [Cucumber plugin](https://marketplace.visualstudio.com/items?itemName=CucumberOpen.cucumber-official) for Visual Studio Code or any other plugin# How to use
1) Create new class library for .NET 8+
2) Add following nuget packages:
- https://www.nuget.org/packages/NGherkin
- https://www.nuget.org/packages/NGherkin.TestAdapter
- https://www.nuget.org/packages/Microsoft.NET.Test.Sdk
3) Create startup class and register dependencies. Example:
```csharp
public sealed class Startup : StartupBase
{
public override void Configure(IServiceCollection services)
{
services.AddGherkinFeatures();
services.AddGherkinSteps();
}
}```
4) Add feature files
5) Add classes with steps. Example:```csharp
[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()
{
}
}
```