- A Github action to run SpecFlow tests and create a SpecFlow+ LivingDoc artifact
- SpecFlow projects must have a Package Reference to SpecFlow.Plus.LivingDocPlugin in the .csproj
dotnet add package SpecFlow.Plus.LivingDocPlugin
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- uses: actions/cryptic-wizard/[email protected]
with:
test-assembly-path: MySpecflowProject/bin/Release/net7.0
test-assembly-dll: MySpecflowProject.dll
output-html: MyTestResults.html
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/[email protected]
with:
test-assembly-path: MySpecflowProject/bin/Release/net7.0
test-assembly-dll: MySpecflowProject.dll
output-html: ${{ matrix.os }}.html
- Target multiple frameworks in the .csproj
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
- uses: actions/cryptic-wizard/[email protected]
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
- 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:
Features planned when 'uses' keyword is implemented in composite actions
- Checkout automatically
- Setup dotnet automatically
- Dotnet framework matrix testing