Skip to content

Tool for syncing gherking and specflow-results against work-systems (eg Azure DevOps, GitHub Issues and Monday)

License

Notifications You must be signed in to change notification settings

Nonsultant/specgurka

Repository files navigation

SpecGurka

Is a collection of tools for working with the test result of an automated BDD process, based on gherkin-feature files and a test automation tool (like reqnroll).

GenGurka

GenGurka NuGet

GenGurka is a command-line tool designed to pull data from Gherkin feature files and combine it with test results in trx-format to generate a .gurka file. This file is used by the VizGurka web-application to visualize the test results of BDD (Behavior-Driven Development) processes.

Key Features

  • Combines Gherkin and Test Results: GenGurka merges the information from Gherkin feature files and test results to create a comprehensive .gurka file.
  • Pipeline Integration: The tool is designed to be used within a release pipeline, such as a GitHub Action, to automate the generation of .gurka files.
  • Easy to Use: GenGurka provides a simple command-line interface with options and arguments to customize the generation process. That is easily installed as a dotnet tool.

Custom Tag: @draft

When writing Gherkin you can use the @draft tag in combination with @ignore on a feature level to mark the feature as a draft. This will give the feature a special status icon indicating that it is a draft.

Status Propagation

There are 3 different statuses that are a reflection of the truth based on test-logs. Passed, Not Implemented(Skipped) and Failed. Draft is the fourth status but it is just a visual representation of a feature tagged with @draft in combination with @ignore, So in reality it is Not Implemented.

It is important to recognize how these statuses propagate up and down to its parents and children. Failed will always take precedent over any other status in propagation.

If a feature is Failed/Skipped, then every child will be Failed/Skipped (Rule and Scenarios).

If a Rule is Failed/Skipped, then every child scenario to that rule and the parent feature of that rule will be Failed/Skipped. But other rules and scenarios outside the Failed/Skipped marked rule remains unaffected. In other words, parent features who inherits a status will not propagate its status down to other children.

If a Scenario is Failed/Skipped, then its parent rule, and in turn it's parent feature will be Failed/Skipped.

Usage

The tool is published to Nuget: packages/GenGurka

  1. Install the Tool: Install GenGurka as a .NET tool within your pipeline after installing .NET:

    dotnet tool install gengurka
  2. Generate .gurka File: Navigate to the test project directory and run the tool with the appropriate options and arguments:

    Arguments:

  • -trx <path>: Path to the trx file from the dotnet test command.
  • -o <path> or --output-path <path>: Path to the output file of the .gurka file. Default is the current directory.
  • -f <path> or --feature-directory <path>: Path to the directory containing the feature files. Default is the Features directory in the current directory.
  • -p <name> or --project-name <name>: Name of the project the result is created from.
  • -a <path> or --assembly <path>: Path to the test assembly file.
  • -url <https://www.github.com/{owner}/{repository}> or --base-url <https://www.github.com/{owner}/{repository}>: url to the project repository

Example:

dotnet test tests/reqnrollDemo.Spec --logger "trx;LogFileName=test-results.trx"
gengurka -p My-Awesome-Test-Project -trx tests/reqnrollDemo.Spec/TestResults/test-Results.trx -f tests/ReqnrollDemo.Spec/Features

With SpecGurka as a demo repository this will create the .trx needed and then the .gurka file will be generated in the correct directory to be used with VizGurka.

  1. Transfer the .gurka File: The generated .gurka file will be created in the current directory. Transfer this file to your VizGurka application for visualization.

GenGurka simplifies the process of combining Gherkin feature files and test results, making it easier to visualize and analyze BDD test outcomes with VizGurka.

VizGurka

VizGurka is a ASP.NET core Razor pages web application designed to visualize the test results of Gherkin-based BDD (Behavior-Driven Development) tests. It processes input from .gurka files, which are generated by combining Gherkin feature files with test results, this is handled by GenGurka.

Key Features

  • Visualization of Test Results: VizGurka displays the results of BDD tests in a clear and organized way, making it easy to understand the status of various scenarios and features even by non-technical users.
  • Automatic File Handling: The application automatically selects the latest .gurka file based on date and time from the GurkaFiles directory and uses it to display the test results.
  • Gherkin Syntax Support: VizGurka supports a lot of the different kinds of Gherkin syntax, for example descriptions, rules, scenario-outline, and backgrounds.

Usage from source

  1. Generate .gurka Files: Use the GenGurka tool to generate .gurka files from your Gherkin feature files and trx-file test results. See above.
  2. Place .gurka Files in GurkaFiles Directory: Copy the generated .gurka files into the GurkaFiles directory within the VizGurka application.
  3. View Test Results: Open the VizGurka web application to view the latest test results, which are automatically updated based on the most recent .gurka file. Might need a restart also.

VizGurka provides a comprehensive and user-friendly interface for monitoring and analyzing the outcomes of your BDD tests, helping you ensure the quality and reliability of your software.

Usage from docker

  1. Generate .gurka Files: Use the GenGurka tool to generate .gurka files from your Gherkin feature files and trx-file test results. Then Create and put them in the same directory as you've set as shellDirectoryPath and directoryPath in Appsettings.json.
  2. Make sure Docker is installed and running
  3. Add Credentials: Modify SpecGurka/appsettings.example.json with you desired paths and credentials, then rename the file to appsettings.json and create a copy and paste into /../SpecGurka/source/VizGurka/
  4. Build Docker Image: Navigate to /../SpecGurka and run docker build -t vizgurka -f source/VizGurka/Dockerfile .
  5. Start Docker Container: To start your Vizgurka image (default port 8080:8080) run docker run -d --name vizgurka-container -p 8080:8080 vizgurka

VizGurka provides a comprehensive and user-friendly interface for monitoring and analyzing the outcomes of your BDD tests, helping you ensure the quality and reliability of your software.

SyncGurka

A CLI tool to sync feature files written using Gherkin syntax with a work-system (eg. Azure DevOps, GitHub Issues, Monday).

The tool is able to make sure that all feature files have a mapping aginst a work-item and that the data in that system is aligned against the feature file.

It can check the mapping of both features and scenarios to user stories to an workitem service. And make use that the id aligns (the workitem exists).

When creating automated tests based on the scenarios within the features (eg using Specflow), is it possible to update the feature in the workitem service with the result.

The system consist of two modes. A commandline argument can be used to select mode (if no argument is provided, should the defult mode just run)

  • Mode 1 (default): Verify and validate gherking-files against workitem service
  • Mode 2: Mode 1 + Update workitem in service with results of automated test (eg. Specflow)

Thanks

This tools is orginaly developed as an student internship during the fall 2022 by:

About

Tool for syncing gherking and specflow-results against work-systems (eg Azure DevOps, GitHub Issues and Monday)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •