Xunit retryFact属性如何工作?
我的硒测试由Xunit运行。我在C#上写测试。某些测试不稳定(尤其是使用鼠标动作的测试)。我在Xunit中找到了retryFactattribute,但找不到任何文档。
我目前的主要问题是:如果我使用[retryfact(delaybetweenretriesms:3000)]
?
如果可以的话,请建议我在其中找到有关属性的更多信息的资源。
I have Selenium tests which are run by XUnit. I write tests on c#. Some of the tests are not stable (especially those which uses mouse actions). I found the RetryFactAttribute in XUnit but I can't find any documetation for it.
My main question for now: will xUnit run other tests while waiting 3 seconds if I use [RetryFact(delayBetweenRetriesMs: 3000)]
?
If you can, please suggest resource where I can find more information about the attribute.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它似乎是如何使用自定义
ixunittestCasediscoverer
和xunittestcase
的示例。您可以找到示例源代码Ultimately it's just an attribute with the following attribute attached to it:
Which then indirectly references
我不确定您的问题是否会在单个测试中阻止单个测试3秒钟,但是从这个问题来看,我认为答案可能是“是”。最好在实验上测试这一问题。
It appears to be an example of how to use a custom
IXunitTestCaseDiscoverer
andXunitTestCase
. You can find the example source code here.Ultimately it's just an attribute with the following attribute attached to it:
Which then indirectly references RetryTestCase.cs (a derivative of
XunitTestCase
) where its actual behaviour is defined:I'm not 100% sure about your question re whether it will block on a single test for 3 seconds, but judging by this I think the answer is probably "yes". It's best to test this experimentally to be sure.