How to have multiple test in jira x-ray, for unit test with different testcase after importing Nunit testresult.xml

huangapple go评论49阅读模式
英文:

How to have multiple test in jira x-ray, for unit test with different testcase after importing Nunit testresult.xml

问题

我已经用 C# .NET Core 3.0 和 NUnit 框架编写了一个 API 单元测试,执行结束后测试框架会生成 Testresult.xml,然后我会将其导入到 Jira Xray 用于创建一个测试套件。

现在,我在一个单元测试名称下有多个测试用例,虽然在 testresult.xml 中我能看到相同数量的测试用例,但当我上传到 Jira Xray 后,只显示一个测试用例名称。
可能是因为相同的单元测试名称导致被覆盖了。
我应该怎样在 Jira Xray 中拥有多个测试用例?

以下是代码示例:

#region --ThermostatMode--
//[Category("AllDevices")]
[Category("FlyCatcher")]
[TestCase("Cool","LCC","FlyCatcher")]
[TestCase("Heat","LCC","FlyCatcher")]
[TestCase("Off", "LCC","FlyCatcher")]
public void LCC_ThermostateMode_FlyCatcher_Positive(string TestCaseID,string deviceType, string deviceName)
{
    UnitTest_ThermostateMode_FlyCatcher.LCC_ThermostateMode_FlyCatcher_Positive(test, extent, TestCaseID, deviceType, deviceName, JsonInputDetail);
}
#endregion

在执行上述代码后,我得到了包含所有测试用例覆盖的 Testresult.xml。但当我将 xml 上传到 Jira Xray 时,它只创建了一个名为 LCC_ThermostateMode_FlyCatcher_Positive 的测试,而我希望在 Jira Xray 中创建 3 个测试。
当我点击它时,它没有显示出为哪个测试用例创建的信息。
有人能帮帮我吗?

英文:

I have written a API unit test in C# .net core 3.0 using Nunit framework end of the execution the test framework creates Testresult.xml which at the end I import to Jira xray for creating a test suit..

Now, I have multiple Test cases under 1 unit test name and I can see the same count of test is being created in testresult.xml but when I upload it to jira xray, it shows only one test case name.
possibly it's been overwritten due to the same unit test name.
How can I have multiple test in jira xray ?

Here is the code sample.

#region --ThermostatMode--
        //[Category("AllDevices")]
        [Category("FlyCatcher")]
        [TestCase("Cool","LCC","FlyCatcher")]
        [TestCase("Heat","LCC","FlyCatcher")]
        [TestCase("Off", "LCC","FlyCatcher")]
        public void LCC_ThermostateMode_FlyCatcher_Positive(string TestCaseID,string deviceType, string deviceName)
        {
            UnitTest_ThermostateMode_FlyCatcher.LCC_ThermostateMode_FlyCatcher_Positive(test, extent, TestCaseID, deviceType, deviceName, JsonInputDetail);
        }

        #endregion

After executing the above code, I get Testresult.xml with all the test case coverage and when I upload the xml to jira xray, It creates only one test with LCC_ThermostateMode_FlyCatcher_Positive, instead, I need 3 tests to be created in jira xray.
and when I click on it, it doesn't have any information on which for which testcase the testcase has been created.
Somebody please help me.

How to have multiple test in jira x-ray, for unit test with different testcase after importing Nunit testresult.xml

答案1

得分: 1

从NUnit XML报告导入结果时,将创建一个测试执行问题,以及每个测试方法的测试(以及结果的相关测试运行)。
要查看每个测试的执行结果(即测试运行),您需要向右滚动一点并选择“播放”图标。
对于数据驱动的测试,目前这些将被导入为测试运行中的多个条目。因此,您将创建一个与测试方法相关的测试问题,一个包含3个结果的测试运行。

英文:

Whenever importing results from NUnit XML reports, a Test Execution issue will be created along with a Test (and the related test run for the results) for each test method you have.
To see the execution results of each test (i.e. the Test Run) you have to scroll a bit to the right and choose the "play" icon.
For data-driven tests, right now those will be imported as multiple entries on the Test Run. So, you'll have 1 Test issue created related to the test method, one Test Run with 3 results within it.

huangapple
  • 本文由 发表于 2023年2月6日 20:52:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/75361552.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定