我们的团队正在迁移到VSTS,并且正在创建新的测试用例以及从旧的Word文档重新创建测试用例。创建了一些测试用例作为占位符,以便稍后回填测试步骤。
是否可以检索测试用例中的步数?
答案 0 :(得分:0)
您可以通过API检索测试用例步骤的数量:
var u = new Uri("https://XXX.visualstudio.com");
var c = new VssClientCredentials();
TfsTeamProjectCollection _tfs = new TfsTeamProjectCollection(u, c);
_tfs.EnsureAuthenticated();
ITestManagementService test_service = (ITestManagementService)_tfs.GetService(typeof(ITestManagementService));
ITestManagementTeamProject project = test_service.GetTeamProject("[team project]");
ITestPlan plan = project.TestPlans.Find([test plan id]);
ITestCase testcase = project.TestCases.Find([test case id]);
Console.WriteLine(testcase.Actions.Count);
Console.Read();