1

As a user, while executing the test cases created for the API Request, I'm expecting that it must show the value of the assertion even if the test cases pass.

For Example:

pm.test("User ID Should Exist", ()=>{

    value = bodyData.data.currentUser.id

    pm.expect(value).to.exist

    pm.environment.set("userID", value) 
})

When I run it, so it displays:

PASS - User ID Should Exist

How can I print the value of the User Id, even if the case passes on the test result section/tab?

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37

1 Answers1

1

You could do the following:

value = bodyData.data.currentUser.id

pm.test("User ID '" + value + "' should Exist", ()=>{

    pm.expect(value).to.exist

    pm.environment.set("userID", value) 
}) 
Christian Baumann
  • 3,188
  • 3
  • 20
  • 37