Skip to content
check-square

GitHub Action

Run SpecFlow Tests

v1.3.3 Latest version

Run SpecFlow Tests

check-square

Run SpecFlow Tests

A Github Action to run SpecFlow tests and create a LivingDoc

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Run SpecFlow Tests

uses: cryptic-wizard/run-specflow-tests@v1.3.3

Learn more about this action in cryptic-wizard/run-specflow-tests

Choose a version

Description

dotnet add package SpecFlow.Plus.LivingDocPlugin
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />

Tests

.NET 6

.NET 7

Usage

Minimal:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
  with:
    dotnet-version: '7.0.x'
- uses: actions/cryptic-wizard/run-specflow-tests@v1.3.3
  with:
    test-assembly-path: MySpecflowProject/bin/Release/net7.0
    test-assembly-dll: MySpecflowProject.dll
    output-html: MyTestResults.html

Test Multiple Operating Systems in the Same Workflow:

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    
  steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-dotnet@v4
    with:
      dotnet-version: '7.0.x'
  - uses: actions/cryptic-wizard/run-specflow-tests@v1.3.3
    with:
      test-assembly-path: MySpecflowProject/bin/Release/net7.0
      test-assembly-dll: MySpecflowProject.dll
      output-html: ${{ matrix.os }}.html

Test Multiple Frameworks in Separate Workflows:

  • Target multiple frameworks in the .csproj
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

Optional parameters:

- uses: actions/cryptic-wizard/run-specflow-tests@v1.3.3
  with:
    test-assembly-path: MySpecflowProject/bin/Debug/net7.0
    test-assembly-dll: MySpecflowProject.dll
    test-execution-json: TestExecution.json
    configuration: Debug
    output-html: MyTestResults.html
    build-verbosity: normal
    test-verbosity: minimal
    filter: TestCategory=CategoryA
    framework: net7.0
    no-build: true
    logger: trx
    logger-file-name: ../../MyTestResults.trx
    upload-artifact: false

LivingDoc Output Example

SpecflowLivingDoc

SpecflowAnalytics

Features

Recently Added

  • v1.3.3 - Add filter option
filter:
  • v1.3.2 - Patch for Github action exit code change - thanks again to awgeorge
  • v1.3.1 - test-execution-json now has default value
test-execution-json: 'TestExecution.json' by default
  • v1.3.0 - Autopublish artifacts - thanks awgeorge!
upload-artifact: true by default
  • v1.2.0 - Add configuration option
configuration:
  • v1.1.0 - Set working folder for test-assembly-dll and test-execution-json
test-assembly-path:
  • v1.1.0 - Allow other test loggers to be run in addition to SpecFlow
logger:
logger-file-name:

Planned Features

Features planned when 'uses' keyword is implemented in composite actions

  • Checkout automatically
  • Setup dotnet automatically
  • Dotnet framework matrix testing

Tools

License