"); + } + else + { + if (IsImage(a)) + { + source += $"
"; + } + else + { + source += $"
File attached to test case: {a}
"; + } + } + return source; + } + protected static List"); - } - else - { - if (IsImage(a)) - { - s.Action += $"
"; - } - else - { - s.Action += $"
File attached to test case: {a}
"; - } - } + s.Action = HandleStepImageLink(s.Action, a, attachments); }); s.ExpectedAttachments?.ForEach(a => { - if (s.Expected.Contains($"<<<{a}>>>")) - { - s.Expected = s.Expected.Replace($"<<<{a}>>>", $""); - } - else - { - if (IsImage(a)) - { - s.Expected += $"
"; - } - else - { - s.Expected += $"
File attached to test case: {a}
"; - } - } + s.Expected = HandleStepImageLink(s.Expected, a, attachments); }); s.TestDataAttachments?.ForEach(a => { - if (s.TestData.Contains($"<<<{a}>>>")) - { - s.TestData = s.TestData.Replace($"<<<{a}>>>", $""); - } - else - { - if (IsImage(a)) - { - s.TestData += $"
"; - } - else - { - s.TestData += $"
File attached to test case: {a}
"; - } - } + s.TestData = HandleStepImageLink(s.TestData, a, attachments); }); }); diff --git a/Migrators/Importer/Services/TestCaseService.cs b/Migrators/Importer/Services/TestCaseService.cs index 9a14bf4..a19cc30 100644 --- a/Migrators/Importer/Services/TestCaseService.cs +++ b/Migrators/Importer/Services/TestCaseService.cs @@ -97,6 +97,8 @@ private async Task ImportTestCase(Guid projectId, TestCase testCase) tmsTestCase.Attachments = attachments.Select(a => a.Value.ToString()).ToList(); tmsTestCase.Steps = AddAttachmentsToSteps(tmsTestCase.Steps, attachments); + tmsTestCase.PreconditionSteps = AddAttachmentsToSteps(tmsTestCase.PreconditionSteps, attachments); + tmsTestCase.PostconditionSteps = AddAttachmentsToSteps(tmsTestCase.PostconditionSteps, attachments); await _client.ImportTestCase(projectId, sectionId, tmsTestCase);