Open creage opened 4 years ago
Hi, if Jest "knows" about those attachments, it should be possible to add. If you have the time to make a PR I would be happy to assist you :)
Jest might not know, but we can extend it with such feature using custom environment definition, right?
async handleTestEvent(event, state) {
if (event.name === 'test_done' && event.test.errors.length){
// generate log for failed test, take screenshots etc.
// update test result with paths to generated assets
}
}
And then later, when generating a TRX, we should extend UnitTestResult
node with new entry ResultFiles
and list all of assets reported as new ResultFile
<UnitTestResult executionId="6ec687ce-ef77-4663-983e-234cc56bc552" testId="60969a90-a9f5-0eee-9352-958101d70ba3" testName="TypeTextAndSendMessageFromMessageSendMessagePage" computerName="AUTOTEST1" duration="00:01:45.4448068" startTime="2016-08-12T03:27:58.9283005-05:00" endTime="2016-08-12T03:29:44.4760561-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="6ec687ce-ef77-4663-983e-234cc56bc552">
<ResultFiles>
<ResultFile path="OUR_PATH_TO/ASSET.EXT" />
</ResultFiles>
</UnitTestResult>
Or am I missing the point?
Hm, that could work, but the API to define this could be tricky to design. Do you have the time to have a try at this?
I took a try at this, but haven't done full E2E testing, so still in progress: https://github.com/no23reason/jest-trx-results-processor/pull/381
A couple things to note:
duration * testIndex
, so this is likely ineffective
During our test runs some of tests might produce some artifacts, like screenshots, logs, etc. Since VSTest supports attachments, I wonder if it would be possible to add this feature to this reporter?
Some info about.