AzureDevOps-将“Automationstatus更新为“Automated后如何撤销?
创始人
2024-09-29 15:00:42
0

可以通过以下代码来撤销将“Automation status”更新为“Automated”:

  1. 打开“Test Plan”视图
  2. 选择要撤销更改的测试用例
  3. 点击右键,在弹出菜单中选择“历史记录…”
  4. 在历史记录中,找到要撤销的更改并选择它
  5. 点击“撤销”按钮,然后保存更改

示例代码如下:

using Microsoft.TeamFoundation.TestManagement.Client;

// Connect to the TFS server
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("http://tfsserver:8080/tfs"));
tfs.Authenticate();

// Get the test plan
ITestManagementService tms = tfs.GetService();
ITestManagementTeamProject project = tms.GetTeamProject("project name");
ITestPlan plan = project.TestPlans.Find(1);

// Find the test cases to undo the update for
ITestCaseCollection testCases = plan.RootSuite.AllTestCases;
foreach (ITestCase testCase in testCases)
{
    if (testCase.Title == "Test Case Title")
    {
        // Undo the update
        testCase.Actions.RemoveAt(0);
        testCase.Actions.Add(new Microsoft.TeamFoundation.TestManagement.Client.DesignStep()
        {
            ExpectedResult = "Expected result",
            Description = "Description",
            StepNumber = 1
        });

        // Save the changes
        project.WitBatchSave(testCase.WorkItem);
        break;
    }
}

其中,“Test Case Title”应该替换为要撤销更改的测试用例的标题。

相关内容

热门资讯

微信小程序微乐内蒙破解器!微乐... 微信小程序微乐内蒙破解器!微乐小程序黑科技(透视)神器-果然分享真的是有挂进入游戏-大厅左侧-新手福...
9分钟安装!微乐自建房透视,微... 9分钟安装!微乐自建房透视,微乐小程序黑科技,讲义教程(有挂工具)-哔哩哔哩1、微乐小程序黑科技有没...
微乐山西小程序破解器!微乐小程... 微乐山西小程序破解器!微乐小程序免费黑科技(透视)教程-一贯科普存在有挂1、游戏颠覆性的策略玩法,独...
第四分钟插件!小程序微乐斗地主... 第四分钟插件!小程序微乐斗地主辅助,微乐小程序黑科技,积累教程(有挂辅助)-哔哩哔哩1、下载好小程序...
微乐老友广东辅助器!微乐小程序... 微乐老友广东辅助器!微乐小程序黑科技(透视)技巧-竟然揭露真的有挂1、任何微乐小程序黑科技透视是真的...
第九分钟辅助!微乐小程序自建房... 第九分钟辅助!微乐小程序自建房透视,微乐小程序免费黑科技,妙招教程(有挂修改器)-哔哩哔哩1、下载好...
微信微乐有挂没有!微乐小程序免... 微信微乐有挂没有!微乐小程序免费黑科技(透视)教程-真是有挂有挂1、上手简单,内置详细流程视频教学,...
五分钟脚本!微乐卡五星祈福有用... 五分钟脚本!微乐卡五星祈福有用吗,微乐小程序黑科技,操作教程(有挂脚本)-哔哩哔哩1、每一步都需要思...
透视了解!aapoker辅助器... 透视了解!aapoker辅助器怎么用(透视)hhpoker必备开挂-切实真的有挂(哔哩哔哩)一、aa...
透视了解!aapoker ai... 透视了解!aapoker ai插件(透视)德州hhpoker是真的吗-好像真的有挂(哔哩哔哩)1、超...