2
에 나열된 올바른 순서로 테스트 결과를 가져올 수 없습니다. 테스트 사례에서 실행 된 각 단계의 결과로 보고서를 작성하려고하는데 테스트 단계, 예상 결과, 단계 결과를 검색 할 수 있습니다. , 오류 메시지, 첨부 파일.MTM
테스트 단계와 예상 결과는 MTM에서 볼 수있는 올바른 순서로 나열되어 있지만 검색 한 모든 테스트 사례에 대해 단계 결과와 오류 메시지가 다시 정렬 된 것처럼 보입니다. 이것은 내 코드입니다. 제발 도와주세요.
foreach (ITestSuiteEntry testcase in ts.TestCases)
{
var testResults = testProject.TestResults.ByTestId(testcase.TestCase.Id);
foreach (ITestCaseResult result in testResults)
{
for (int actionIndex = 0; actionIndex < testcase.TestCase.Actions.Count; actionIndex++)
{
resultData = new TestResultData();
var actionStep = testcase.TestCase.Actions[actionIndex] as ITestStep;
if (actionStep != null)
{
resultData.TestCaseName = result.TestCaseTitle;
resultData.Step = Regex.Replace(actionStep.Title, @"<[^>]+>| ", "").Trim();
resultData.ExpectedResult = Regex.Replace(actionStep.ExpectedResult, @"<[^>]+>| ", "").Trim();
}
var topIteration = result.Iterations.FirstOrDefault();
if (topIteration != null && actionIndex < topIteration.Actions.Count)
{
var actionResult = topIteration.Actions[actionIndex];
resultData.StepOutcome = actionResult.Outcome.ToString();
resultData.Comment = actionResult.ErrorMessage;
foreach (var attachment in actionResult.Attachments)
{
resultData.AttachmentName = attachment.Name;
resultData.AttachmentUri = attachment.Uri.ToString();
}
}
resultDataList.Add(resultData);
}
}
}
: 작업 항목을 다운로드 할 수 WorkItemStore 클래스는 다음 개별 파일을 다운로드 할 웹 클라이언트를 사용하여모든 단계에서 결과가 연관 될 수있는 것은 아닙니다. – jessehouwing
정말 고마워요! 그 매력처럼 작동합니다. 질문이 하나 더 있습니다. 첨부 파일을 결과 테스트 단계 및 테스트 사례에 연결할 수 있다는 것을 알고 있습니다. 테스트 결과에 링크 된 첨부 파일을 검색 할 수 있습니다. 테스트 케이스에 연결된 첨부 파일을 어떻게 검색 할 수 있는지 알려주십시오. 감사합니다. – Div