SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

What happens in Between Scenarios in Hooks File

Open kashifchoudhry opened this issue 4 years ago • 4 comments

I have a specflow project where I have multiple feature files; and in each feature file; have multiple scenarios with multiple steps in each scenario.

I manage certain administrative tasks in the Hooks file for each of the BeforeSuite, BeforeFeature, BeforeScenario and BeforeStep as well as the Afters ...

My question I can follow the workflow that happens before a scenario as that is defined in the Before Scenario; as well as can follow the workflow that happens after a scenario as that is defined in the After Scenario definition. But what I cannot understand or see is what is happening after the After Scenario has completed and before the BeforeScenario of the next test/scenario commences. I can see an average of just under 4 seconds elapsing between the two scenarios correlating to this event. I would like to know where that time is going and if possible to reduce that.

Appreciated if anyone can let me know where to look at for this.

My setup is using VS 2019, C# and Specflow.

kashifchoudhry avatar Feb 10 '21 18:02 kashifchoudhry

Which test runner are you using?

Could you create a project where we can reproduce the behavior?

SabotageAndi avatar Feb 11 '21 08:02 SabotageAndi

@kashifchoudhry please attach the files and not have them in the text. First, it is truncated and it's very hard to read.

SabotageAndi avatar Feb 15 '21 16:02 SabotageAndi

Oh... I thought the files got attached. I am sorry, my bad.

Here, attaching them again.

The packages used in the project are in the enclosed file. I am not sure I can create a project to reproduce the behavior since the project is quite large.

But I can include the Hooks file as well to give an idea of what’s happening.

Hooks.txt = Hooks.cs packages.txt = packages.config

Kashif packages.txt Hooks.txt

From: Andreas Willich [email protected] Sent: February 15, 2021 9:15 AM To: SpecFlowOSS/SpecFlow [email protected] Cc: kashifchoudhry [email protected]; Mention [email protected] Subject: Re: [SpecFlowOSS/SpecFlow] What happens in Between Scenarios in Hooks File (#2304)

kashifchoudhry avatar Feb 16 '21 03:02 kashifchoudhry

Hi There,

It's been more than a month now that I posted the update to the issue. Just wondering if there has been any further investigation into this issue?

Thanks, Kashif

From: Kashif Choudhry Sent: February 15, 2021 7:53 AM To: SpecFlowOSS/SpecFlow @.>; SpecFlowOSS/SpecFlow @.> Cc: Author @.***> Subject: RE: [SpecFlowOSS/SpecFlow] What happens in Between Scenarios in Hooks File (#2304)

The packages used in the project are in the enclosed file. I am not sure I can create a project to reproduce the behavior since the project is quite large.

But I can include the Hooks file as well to give an idea of what's happening.

Enclosed:

  • Packages.congif
  • Hooks.cs

From: Andreas Willich @.@.>> Sent: February 11, 2021 1:28 AM To: SpecFlowOSS/SpecFlow @.@.>> Cc: kashifchoudhry @.@.>>; Author @.@.>> Subject: Re: [SpecFlowOSS/SpecFlow] What happens in Between Scenarios in Hooks File (#2304)

Which test runner are you using?

Could you create a project where we can reproduce the behavior?

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSpecFlowOSS%2FSpecFlow%2Fissues%2F2304%23issuecomment-777274728&data=04%7C01%7C%7C559b154d7339440c1a8108d8ce66e6c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637486288635322766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=E9lNnPqrot5r2M8FLt8QLZzIzdh3ujCT2U8EOvg5qFg%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGC3MVHT5NIBMPLDTLSSG6DS6OIH5ANCNFSM4XNM7YXQ&data=04%7C01%7C%7C559b154d7339440c1a8108d8ce66e6c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637486288635332763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=r1zYtE6usV%2F43TCoV2Gw6%2FWGAgWCnzVNKDjH4FEaUGk%3D&reserved=0.

kashifchoudhry avatar Mar 25 '21 16:03 kashifchoudhry