问题描述
我是 Jest 的新手,我正在尝试使用 jest-trx-results-processor 为 Jest 生成 trx 文件(以在 azure ADO 中发布结果)。
我能够生成 trx,但在将结果文件添加到测试失败时遇到困难。
现在它只创建没有 ResultFile 的 UnitTest 节点,例如下面:
<UnitTestResult executionId="df9fd2e3-5889-4c60-9019-583cd48bf821" testId="3a7d9eab-0d0a-02bc-d094-3409dbb19e06" testName="TestMethod3" computerName="name-Z2" duration="00:00:00.0277049" startTime="2021-03-12T12:21:45.2193871+05:30" endTime="2021-03-12T12:21:45.2473877+05:30" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="df9fd2e3-5889-4c60-9019-583cd48bf821">
<Output>
<StdOut>TestContext.TestName='TestMethod3' static _testContext.TestName='TestMethod1'</StdOut>
<ErrorInfo>
<Message>Assert.IsTrue Failed. </Message>
<StackTrace> at UnitTestProject1.UnitTest1.TestMethod3() in C:\Users\name\source\repos\UnitTestProject1\UnitTestProject1\UnitTest1.cs:line 33</StackTrace>
</ErrorInfo>
</Output>
</UnitTestResult>
但我想要如下内容:
<UnitTestResult executionId="df9fd2e3-5889-4c60-9019-583cd48bf821" testId="3a7d9eab-0d0a-02bc-d094-3409dbb19e06" testName="TestMethod3" computerName="name-Z2" duration="00:00:00.0277049" startTime="2021-03-12T12:21:45.2193871+05:30" endTime="2021-03-12T12:21:45.2473877+05:30" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="df9fd2e3-5889-4c60-9019-583cd48bf821">
<Output>
<StdOut>TestContext.TestName='TestMethod3' static _testContext.TestName='TestMethod1'</StdOut>
<ErrorInfo>
<Message>Assert.IsTrue Failed. </Message>
<StackTrace> at UnitTestProject1.UnitTest1.TestMethod3() in C:\Users\name\source\repos\UnitTestProject1\UnitTestProject1\UnitTest1.cs:line 33
</StackTrace>
</ErrorInfo>
</Output>
**<ResultFiles>
<ResultFile path="MachineName-Z2\IMG-20210309-WA0002.jpg" />
</ResultFiles>**
</UnitTestResult>
谁能帮助我如何使用 jest-trx-results-processor 在 trx 中获取 ResultFiles 节点?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)