gpt4 book ai didi

mstest - TestCaseFilter下如何处理多个TestCategory

转载 作者:行者123 更新时间:2023-12-03 21:03:29 24 4
gpt4 key购买 nike

我正在尝试在我的代码中调用 3 个 TestCategory 中的一个

测试类别是:-

[TestCategory("SystemOne"), TestCategory("FunctionalTest"), TestCategory("RegressionTest"), TestCategory("Sanity")
VSTest调用测试类别的代码是:
"cmd.exe" "/c vstest.console.exe $automationDLL /Settings:$automationRunSetting /TestCaseFilter:TestCategory=Sanity /logger:trx"
VSTest代码仅在 TestCaseFilter:TestCategory=SystemOne 时有效即第一个 TestCategory。我无法调用 Sanity TestCategory,即 TestCaseFilter:TestCategory=Sanity等等

最佳答案

在我的机器上工作正常。您是否阅读过 TestCaseFilter 限制?

The MSTest adapter in Visual Studio also works in legacy mode (equivalent to running tests with mstest.exe) for compatibility. In legacy mode, it can't take advantage of the TestCaseFilter feature. The adapter can switch to legacy mode when a testsettings file is specified, forcelegacymode is set to true in a runsettings file, or by using attributes such as HostType.



和:

The /TestCaseFilter command-line option cannot be used with the /Tests command-line option.



尝试在没有 /Settings 的情况下运行它选项。

关于mstest - TestCaseFilter下如何处理多个TestCategory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56142312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com