![]() |
VOOZH | about |
dotnet add package NatLaRestTest.Bindings --version 0.0.20
NuGet\Install-Package NatLaRestTest.Bindings -Version 0.0.20
<PackageReference Include="NatLaRestTest.Bindings" Version="0.0.20" />
<PackageVersion Include="NatLaRestTest.Bindings" Version="0.0.20" />Directory.Packages.props
<PackageReference Include="NatLaRestTest.Bindings" />Project file
paket add NatLaRestTest.Bindings --version 0.0.20
#r "nuget: NatLaRestTest.Bindings, 0.0.20"
#:package NatLaRestTest.Bindings@0.0.20
#addin nuget:?package=NatLaRestTest.Bindings&version=0.0.20Install as a Cake Addin
#tool nuget:?package=NatLaRestTest.Bindings&version=0.0.20Install as a Cake Tool
Natural Language REST API Testing Framework
This project aims to simplify the process of testing REST APIs by leveraging natural language processing techniques, powered by the excellent Reqnroll. It allows testers to write test cases in plain English, making it easier for non-technical stakeholders to understand and contribute to the testing process.
TL;DR: A set of Reqnroll Bindings for writing REST API tests in Natural Language.
Given the base URL 'https://awesome-api.de'
When a request to '/produces/1' is made
Then the response code equals '200'
See the NatLaRestTest.Demo project for more usage examples or the full listing of implemented bindings.
NatLaRestTest provides a project template. Install and use it as follows:
dotnet new install NatLaRestTest.Template
dotnet new natlaresttest -n MyTestProject
This will create a new test project with the necessary dependencies and a sample test case named MyTestProject.
Check if it runs correctly via dotnet test, and then start writing your own test cases.
You can run tests created with this framework using your preferred test runner that supports NUnit, such as the built-in test explorer in Visual Studio, or via command line using the dotnet test command.
Currently, only NUnit is supported as the test framework.
NatLaRestTest provides a system to work with variables in your test cases. Usage of variables in parameters (aka everything enclosed by single quotes in binding expressions) is indicated by the syntax $(variableName).
Do not confuse NatLaRestTest variables with Gherkin Scenario Outlines.
They are combinable, though. The Demo project provides an example for this in the ScenarioOutlineAndExamples.feature file.
There are several ways to define variables for usage in your tests:
Global variables are defined in the globalVariables section of your NatLaRestTestSettings.json configuration file. For example:
"globalVariables": [
{
"name": "demoApiBaseUrl",
"value": "https://localhost:7031"
}
]
and in your test case:
Then the value of variable 'demoApiBaseUrl' equals 'https://localhost:7031'
or, as another example:
Given the base URL '$(demoApiBaseUrl)'
Global variables are available in all scenarios, and are loaded before test execution starts.
You can also define variables in separate JSON files, and load them during the execution of your tests using the step binding.
For example, a file variables.json:
{
"testVariables":[
{
"name": "exampleNumber",
"value": 42
}
]
}
Make sure this file is copied to your output directory during build (set the Copy to Output Directory property of the file to Copy if newer or Copy always) and load these variables during a test scenario by adding the following to your test:
Given the variables file 'variables.json' is loaded
Then the value of variable 'exampleNumber' equals '42'
There are several step bindings available, which allow you to set variables during test execution, e.g. by extracting values from responses or reading a file. See the for more information.
As mentioned before, variables are referenced using the syntax $(variableName) for usage in all parameters (again, indicated by single quotes) or are asked for explicitly by specific bindings like comparisons and mutations. Consider the following example to get a feeling for the capabilities of the system:
When the value 'abc' is stored in variable 'firstParameter'
And the value 'def' is stored in variable 'secondParameter'
And a request to '$(firstParameter)/$(secondParameter)' is made
The above example will result in a request to abc/def.
Furthermore, variables in this syntax are resolved recursively, meaning you can have variables depending on other variables:
When the value 'variableValue' is stored in variable 'varName'
And the value '42' is stored in variable 'variableValue'
And the value '$($(varName))' is stored in variable 'result'
Then the value of variable 'result' equals '42'
NatLaRestTest uses a configuration file named NatLaRestTestSettings.json to manage several settings.
Consider the following example:
{
"additionalConfigurationFiles": [
"./NatLaRestTestSettings.Development.json"
],
"globalVariables": [
{
"name": "stage",
"value": "Development"
}
],
"fileRedirects": [
{
"originalFileName": "settings.json",
"redirect": "settings.$(stage).json"
}
]
}
This block allows you to specify additional configuration files to be loaded by NatLaRestTest. These files can contain environment-specific settings or overrides for the default configuration. All files (and the default entry file) are loaded and merged together before test execution starts. In case of conflicts, the last loaded file wins, meaning that you can use this mechanism to override settings from the default configuration file. This allows you to have both a 'NatLaRestTestSettings.json' file with default settings and additional files like 'NatLaRestTestSettings.Development.json' or 'NatLaRestTestSettings.Production.json' with environment-specific overrides, which can also be included in a .gitignore file to keep secrets like API keys from being committed.
Compare to appsettings.json files in ASP.NET Core applications, which work in a similar way.
This block allows you to define global variables that can be used throughout your tests. Global variables are accessible from any test and can be used to store values that need to be shared across multiple test cases. They are initialized before test execution starts, so they are available right from the beginning of your tests.
This block allows you to defined file redirects. Consider the following test case:
Given the variables file 'variables.json' is loaded
Without any file redirects, NatLaRestTest would try to load the file variables.json directly. However, with the following file redirect defined in the configuration file:
"fileRedirects": [
{
"originalFileName": "variables.json",
"redirect": "variables.$(stage).json"
}
]
NatLaRestTest will instead try to load the file variables.Development.json, assuming the global variable stage is set to Development.
This allows you to easily switch between different files based on the current environment or other criteria defined by your global variables.
In contrast to the mechanism for additional configuration files, file-redirects are not additive. Meaning, no file merging takes place and only the file defined in the redirect is loaded.
NatLaRestTest currently supports only English (en-US) as the language for writing test cases. However, since Reqnroll supports multiple languages, it is possible to translate the bindings into other languages.
NatLaRestTest was designed with localization in mind. To translate the bindings into another language, you would need to create a new set of bindings with the same functionality but with step definitions in the desired language.
See (only translated a few basic bindings to demonstrate the idea) and its .
For an optimal experience when working with NatLaRestTest, it is recommended to use one of the Reqnroll IDE integrations, such as the Visual Studio Extension, the Visual Studio Code Extension or the JetBrains Rider Extension. These integrations provide features like syntax highlighting, autocompletion, and easy test execution directly from the IDE.
Also see my Visual Studio Code Extension which was created with NatLaRestTest in mind, but not bound to it and should work with any Reqnroll based test suite.
Given the natural language basis of NatLaRestTest, it is well-suited for usage with AI agents like GitHub Copilot or others. It has proven effective to "feed" either the or the NatLaRestTest.Bindings.xml to the agent, to familiarize it with the available step bindings. Alternatively, check out this repository and ask GitHub Copilot to create your tests using the bindings in this repository.
Also check out another of my projects, the ReqnRoll MCP Server.
You can use the special Then enter debug mode binding to enter NatLaRestTestDebug mode during test execution, provided a debugger is attached.
In this state, a property named Debug is provided in your debug content. Use the Immediate Window (Visual Studio) or the Debug Console (Visual Studio Code) to execute commands against this property.
See the debug service for the available commands.
This project is licensed under the MIT License. See the file for details.
Information about the licenses of dependencies can be found in the file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.20 | 88 | 6/11/2026 |
| 0.0.19 | 145 | 5/21/2026 |
| 0.0.18 | 171 | 4/10/2026 |
| 0.0.17 | 107 | 4/9/2026 |
| 0.0.16 | 108 | 4/8/2026 |
| 0.0.15 | 119 | 3/29/2026 |
| 0.0.15-preview3 | 112 | 3/29/2026 |
| 0.0.15-preview2 | 109 | 3/29/2026 |
| 0.0.15-preview | 110 | 3/29/2026 |
| 0.0.14 | 111 | 3/29/2026 |
| 0.0.12 | 123 | 3/27/2026 |
| 0.0.11 | 116 | 3/20/2026 |
| 0.0.10 | 123 | 2/22/2026 |
| 0.0.9 | 117 | 2/22/2026 |
| 0.0.8 | 126 | 2/8/2026 |
| 0.0.6 | 114 | 2/5/2026 |
| 0.0.5 | 121 | 2/5/2026 |
| 0.0.4 | 120 | 2/4/2026 |
| 0.0.3 | 118 | 2/4/2026 |
| 0.0.2 | 131 | 2/4/2026 |