Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Defect plugin : How to push the comment of a step to the defect


#1

Hi,

I am using the defect plugin to connect TestRail with Mantis.
The entered comment of the Test result is added to the default description.

I would like to also collect the actual result comments of the steps.
I don’t see any field related to the steps in the $context array

How can I retrieve this information ?

Thanks


#2

Hello Laurent,

Thanks for your posting. The steps are also part of the $context and can be accessed as follows:

(depending on the system name of your results field, in this case ‘step_results’)

Please note that the step results are JSON encoded and you need to decode this as follows:

$steps = json::decode($context['test_change']->custom_step_results); foreach ($steps as $step) { /* $step->index */ /* $step->content */ /* $step->expected */ /* $step->actual */ }

I hope this helps but please let me know in case you have any further questions.

Regards,
Tobias


#3

Thank you for your help, it’s working fine :slight_smile:


#4

That’s great, thanks for the confirmation!

Regards,
Tobias