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.25k stars 754 forks source link

Last [AfterFeature] method not runnin #2515

Open lalberto8085 opened 3 years ago

lalberto8085 commented 3 years ago

SpecFlow Version

3.9.22

Which test runner are you using?

MSTest

Test Runner Version Number

2.2.5

.NET Implementation

equal or greater .NET Framework 4.6.1

Project Format of the SpecFlow project

Sdk-style project format

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

Issue Description

I have several features on my tests and have before and after hooks for scenarios and features. The hooks work as intended until the last feature finishes running and won't execute the AfterFeature hook.

this is an issue since I'm doing cleanup in the AfterFeature.

Steps to Reproduce

  1. Create more than one feature
  2. Make [AfterFeature] hooks
  3. Execute all tests using the VS Test Runner

Link to Repro Project

No response

SabotageAndi commented 3 years ago

Could you please create a project where we can reproduce this issue?