I have written a Test Automation Framework in C# that uses Specflow with SpecFlow+ as the Runner.
I am using TestRail API to write the results to TestRail.
I want to create a new test run when I start the automation tests and then write all of the results to that test run.
So I have written some code using the
[BeforeTestRun]
hook to create a test run.
This works fine when I am running in single thread mode.
But when I run in multi-thread mode, a new test run is created for each thread.
How can I run some code that runs JUST ONCE before the threads are created to create just one test run?