SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.24k stars 754 forks source link

Null hook not executing when using xUnit runner #2531

Closed bengtsjodinTH closed 2 years ago

bengtsjodinTH commented 2 years ago

SpecFlow Version

3.9.40

Which test runner are you using?

xUnit

Test Runner Version Number

2.4.1

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Classic project format using packages.config

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

no section/file generated in Specflow project.

Issue Description

When trying a feature and scenario that has a custom string value the hook is registered but does not execute and replace the value.

Steps to Reproduce

SpecFlowHookExample.zip

I attached the Feature file, the Hook file and generated Step file. When running the Tests using the vs2019 Test explorer the Test runs and the NullValueRetriever is registered but it never executes.

Test result trace: Expected value to be \<null>, but found \"\<null/>\". HookTestResult.zip

Link to Repro Project

-

bengtsjodinTH commented 2 years ago

The missing information on the documentation seems to be what is needed to trigger the Hooks. CreateSet at least triggers the relevant hook.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.