1
Ich habe den folgenden Code, um den Testfall in TFS/MTM zu bestehen. Ich habe erreicht, um den Testfall von außen zu übergeben, aber wenn ich die inneren Schritte des Testfalls überprüfen, sind sie nicht bestanden. Ich schaue, um den Testfall zu führen, indem ich jede Aktion des Testfalls überlasse. jede Hilfe geschätzt.Pass Testfall in TFS mit tfs api
ITestPlan tp = testinsuitesd.Plan;
// foreach (ITestCase testcase in allTestCases)
//{
ITestRun testRun = testinsuitesd.Plan.CreateTestRun(false);
ITestPointCollection testPoints = tp.QueryTestPoints("select * from TestPoint where suiteId= "+ testinsuitesd.Id);
foreach(ITestPoint testRuns in testPoints)
{
testRun.AddTestPoint(testRuns, null);
}
testRun.Save();
ITestCaseResultCollection testCaseResult = testRun.QueryResults(); //code to Pass the test Case
foreach (ITestCaseResult testResult in testCaseResult)
{
ITestIterationResult iterationResult;
ITestActionResult actionResults;
iterationResult = testResult.CreateIteration(1);
//actionResults = testResult.CreateIteration(1);
foreach (ITestAction testStep in testResult.GetTestCase().Actions)
{
ITestActionResult stepResult = iterationResult.CreateStepResult(testStep.Id);
//stepResult.ErrorMessage = String.Empty;
stepResult.Outcome = TestOutcome.Passed; //you can assign different states here
iterationResult.Actions.Add(stepResult);
//actionResults.Add(stepResult);
// iterationResult.Actions.Add(stepResult);
// actionResults. Add(stepResult);
}
iterationResult.Outcome = TestOutcome.Passed;
testResult.Iterations.Add(iterationResult);
testResult.Outcome = TestOutcome.Passed;
testResult.State = TestResultState.Completed;
testResult.Save();
}
testCaseResult.Save(false);
// testCaseResult.
testRun.Save();
testRun.Refresh();
tp.Save();
hallo das Objekt über „_testEditInfo“ verwendet der Typ ist? Können Sie bitte lassen Sie mich wissen, was das Problem mit meinem Code. –