Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

Run SpecFlow Tests

v1.3.0

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.0

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

.NET Core

Usage

Minimal:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
  with:
    dotnet-version: '3.1.x'
- uses: actions/cryptic-wizard/run-specflow-tests@v1.3.0
  with:
    test-assembly-path: MySpecflowProject/bin/Release/netcoreapp3.1
    test-assembly-dll: MySpecflowProject.dll
    test-execution-json: TestExecution.json
    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@v2
  - uses: actions/setup-dotnet@v1
    with:
      dotnet-version: '3.1.x'
  - uses: actions/cryptic-wizard/run-specflow-tests@v1.3.0
    with:
      test-assembly-path: MySpecflowProject/bin/Release/netcoreapp3.1
      test-assembly-dll: MySpecflowProject.dll
      test-execution-json: TestExecution.json
      output-html: ${{ matrix.os }}.html

Test Multiple Frameworks in Separate Workflows:

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

Optional parameters:

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

LivingDoc Output Example

SpecflowLivingDoc

SpecflowAnalytics

Features

Recently Added

  • 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