【发布时间】:2021-09-26 23:28:16
【问题描述】:
在使用 AppDomain 的多线程上使用 Specflow 运行器时,是否有人成功设置了 beforetestrun/aftertestrun 挂钩 我从这个帖子中看到了一些答案 - Run BeforeTestRun and AfterTestRun only once using specflow with Selenium
很遗憾,我很难设置它,因为我们需要它来配置我们的 TestRail 集成。
【问题讨论】:
在使用 AppDomain 的多线程上使用 Specflow 运行器时,是否有人成功设置了 beforetestrun/aftertestrun 挂钩 我从这个帖子中看到了一些答案 - Run BeforeTestRun and AfterTestRun only once using specflow with Selenium
很遗憾,我很难设置它,因为我们需要它来配置我们的 TestRail 集成。
【问题讨论】:
这是可能的——你必须使用基于内核的锁(下面的构造函数是使用的): https://docs.microsoft.com/en-us/dotnet/api/system.threading.semaphore.-ctor?view=net-5.0#System_Threading_Semaphore__ctor_System_Int32_System_Int32_System_String_System_Boolean__
流程:
最好的问候, 下午
【讨论】: