GherkinSimpleParser 1.4.1
dotnet add package GherkinSimpleParser --version 1.4.1
NuGet\Install-Package GherkinSimpleParser -Version 1.4.1
<PackageReference Include="GherkinSimpleParser" Version="1.4.1" />
<PackageVersion Include="GherkinSimpleParser" Version="1.4.1" />
<PackageReference Include="GherkinSimpleParser" />
paket add GherkinSimpleParser --version 1.4.1
#r "nuget: GherkinSimpleParser, 1.4.1"
#:package GherkinSimpleParser@1.4.1
#addin nuget:?package=GherkinSimpleParser&version=1.4.1
#tool nuget:?package=GherkinSimpleParser&version=1.4.1
Description
Library that loads Gherkin syntax from a .feature file to an object in order to export it as formated text. This is not meant to interpret the language.
Parsing
How to use the library
var inputLines = new List<string>();
var gherkinObj = new GherkinObjectParser(inputLines).Parse();
// Replaces scenario outlines with one scenario per case in the "Examples"
// "Examples" markdown block is lost in the process
gherkinObj.TransformScenarioOutlineToClassicScenarioAndOverrideScenarioList();
Supports
- One
Feature
per file - One
Background
per file Scenario
(multiple) (+ aliasExample
)Given
And
(given, multiple)When
And
(when, multiple)Then
And
(then, multiple)*
Alias forAnd
"""
(Doc Strings) (for Given, When, Then, And)|
(Data Tables) (for Given, When, Then, And)@
(Tags) (Before Scenario and Feature)Scenario Outline
(+ aliasScenario Template
)Examples
(+ aliasScenarios
)- Markdown after
Feature
,Background
,Scenario
,Scenario Outline
andExamples
Ignores
- Empty lines (except in Markdown blocks)
#
(Comments)
DOES NOT support (will throw exception)
- Guard clause for wrongly structured files and unexpected lines
- Multiple
Feature
per file Rule
But
Exports (extension, github only)
To be noted
The converter does not transform scenario outlines to classic scenarios before exporting.
The converter does not exports
- Tags
- Markdown blocks
Export as Excel using EPPlus Excel library
Using the applicaiton extension GherkinSimpleParser.Converter
you have access to the class ExcelConverter
that exports the GherkinObject to a predefined Excel TestPlan.
Export as CSV
To be noted
New lines and carriage return are removed from Doc strings ("""
) and from Data Tables (|
).
Export as CSV for testplan with <speparator> for ANDs
Using the applicaiton extension GherkinSimpleParser.Converter
you have access to the class CSVConverter
that does the following:
GherkinObject gherkinObj = GherkinObject.Parse(inputLines));
string separator = "|";
List<string> CSVLines = gherkinObj.ExportAsCSV(separator));
Transforms
Feature: feature name
# As user
# I want to do test cases
# In order to test
Background:
Given Prerequisite_0.1
And Prere"q"uisite_0.2
Scenario: Test Case 1
Given Prerequisite_1.1
And �Prere"q"uisite_1.2
When Action_1
Then Result_1.1
And Resu"l"t_1.2
Scenario: Test Case 2
Given Prerequisite_2.1
And Prere"q"uisite_2.2
When Action_2
Then Result_2.1
And Resu"l"t_2.2
into
"Number;GIVEN;WHEN;THEN",
";GENERAL PREREQUISITES:|Prerequisite_0.1|Prere"q"uisite_0.2;;",
"1;Test Case 1;;",
";Prerequisite_1.1|Prere"q"uisite_1.2;Action_1;Result_1.1|Resu"l"t_1.2",
"2;Test Case 2;;",
";Prerequisite_2.1|Prere"q"uisite_2.2;Action_2;Result_2.1|Resu"l"t_2.2"
More information and sources:
https://github.com/Servan42/GherkinSimpleParser
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.