如何确保SpecFlow功能不能同时运行?

发布于 2025-01-23 03:42:55 字数 210 浏览 2 评论 0 原文

我已经构建了一些规​​格方案来测试HTTP REST接口的功能。当我单独运行功能时,它们工作正常,但是当一起运行时,有些情况有时会失败。失败是没有REST接口Web服务器的答复。

所有功能的第一步是启动REST Interface Web服务器,但是我认为,如果其他方案仍在运行,或者还没有完全完成并且听力端口不能绑定,则可能会失败。

有没有办法确保彼此之后的不同功能运行良好?

I have built some SpecFlow scenarios to test features of a HTTP REST interface. When I run the features separately, they work fine, but when run all together, some of the scenarios sometimes fail. The failure is that there is no reply from the REST interface webserver.

The first step of all features is to start the REST interface webserver, but I reckon this can fail if another scenario is still running, or not yet completely finished and the listening port cannot be bound.

Is there a way to make sure the different features run nicely after eachother?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅笑轻吟梦一曲 2025-01-30 03:42:55

我在 Xunit.runner.json 文件,并添加

 "maxParallelThreads": 1

到配置中。现在只在当时运行一个Specflow测试。

I found the answer on the xUnit documentation site. I added a xunit.runner.json file and added

 "maxParallelThreads": 1

to the config. Only one SpecFlow test is run at the time now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文