我们拥有数千本手册的遗产测试用例在我们本地的 Microsoft 测试管理器中创建TFS 2013.
我们正在努力将他们转移到VSTS事实证明这很困难。
I.
据我所知,目前微软还没有官方的迁移工具,尽管他们正在开发一种用于完整数据迁移
II.
我们尝试了一些第三方工具:
-
OpsHub- 免费版本有 2500 个限制,我们超出了该限制,并且我们无法证明商业版本的 5,000 美元成本是合理的
-
TFS 集成工具- 似乎根本没有迁移测试用例(链接的文档证实了这一点)
-
MTM复制工具- 似乎没有迁移测试用例的步骤,将它们留空
III.
我们还尝试在 Excel 中导出/导入 TFS\VSTS 查询。
这似乎也导出了步骤,但所有步骤都连接在一个字段中,它们之间甚至没有换行符,这使得它非常混乱。
IV.
我们还尝试使用第三方工具通过 Excel 进行导出/导入:
- 导出:https://tfstestcaseexporttoexcel.codeplex.com/- 似乎导出一切都很好,包括步骤!不知道如何将此文件导入 VSTS
- 导入:测试用例迁移器 Plus只是在我的机器上崩溃了,尽管源代码可用,所以也许我会尝试使用它
对于一次性迁移,我可以建议几个选项:
从本地 Web 访问中的测试中心,创建一个包含所有测试用例的测试计划,然后切换到主窗格中的网格视图。您可以在其中选择并复制所有测试用例(包括步骤、预期结果和其他测试用例字段)并将它们粘贴到 VSTS 项目中的等效视图中。
-
创建一个 powershell 脚本,从本地 TFS 获取所有测试用例并将它们复制到 VSTS。
您可以在下面找到一个片段。
警告:我没有对其进行广泛的测试,因此通常的免责声明适用。请添加您可能想要复制的其他字段。
$VerbosePreference = "Continue"
$tfsSource="the collection url that you want to copy form (eg. http://yourserver/tfs/yourcollection)";
$tpSource="the team project containing the test cases you want to copy form";
$tfsDest="the collection url that you want to copy to (eg. https://youraccount.visualstudio.com/DefaultCollection");
$tpDest="the team project containing the test cases you want to copy to";
[Reflection.Assembly]::LoadWithPartialName(‘Microsoft.TeamFoundation.Client’)
[Reflection.Assembly]::LoadWithPartialName(‘Microsoft.TeamFoundation.TestManagement.Client’)
[Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Newtonsoft.Json.dll")
$sourceTpc = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsSource)
$sourceTcm = $sourceTpc.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService])
$sourceProject = $sourceTcm.GetTeamProject($tpSource);
$sourceTestCases = $sourceProject.TestCases.Query(“SELECT * FROM WorkItem”);
$destTpc= [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsDest)
$destTcm = $destTpc.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService])
$destProject = $destTcm.GetTeamProject($tpDest);
foreach ($tc in $sourceTestCases)
{
Write-Verbose ("Copying Test Case {0} - {1}" -f $tc.Id, $tc.Title)
$destTestCase= $destProject.TestCases.Create();
$destTestCase.Title = $tc.Title;
$destTestCase.Priority = $tc.Priority;
foreach ($step in $tc.Actions)
{
$destStep= $destTestCase.CreateTestStep();
$destStep.Title= $step.Title
$destStep.TestStepType= $step.TestStepType
$destStep.Description= $step.Description
$destStep.ExpectedResult= $step.ExpectedResult;
$destTestCase.Actions.Add($destStep);
}
$destTestCase.Save();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)