UnitTesting module error message remote api

0
Hi all,   I’m trying to display a specific message in the error field when a test fails, similar to what’s shown in the documentation. I’ve set the FailureMessage field, and this message appears correctly in the UI timeline. However, it does not show up in the response from the remote API. Instead, I get the following response: { "name": "MainModule.UT_FailTest", "step": "This test is intended to fail to check if the azure devops pipeline is reporting failures correctly", "error": "One or more assertions failed" }   Does anyone know how to include the custom failure message in the remote API response? Thanks in advance!
asked
1 answers
0

Hi Sebastiaan Cales

You can’t override the error field in the test result API response — it always returns the generic assertion failure message. The FailureMessage you set is only shown in the Azure DevOps UI timeline, not exposed through the REST API. If you need the custom message in the API response, you’ll have to log it explicitly (e.g. via test output or attachments) and then consume it from those fields instead.

answered