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

Test_id in AddResultDialog

I want to write a uiscript that will make some decisions about what custom result fields to hide within the add result dialog based on the ID of the current test.

If the add result dialog is launched by pressing the ‘Add Result’ button on the /test/view page, then the current test_id is available in the uiscripts.context, so my script can use this to perform its logic.

However, if the add result dialog is launched by choosing a new status for a test from the status dropdowns in the table on the /runs/view page, then I cant find a way to get hold of the test_id in my code.

i’m subscribing to the ‘result_dialog.loaded’ event to trigger the logic in my script, but this event does not seem to pass any data (unlike the ‘result_dialog.validate’ event which passes data containing the test_id).

Is there a way I can get the current test_id once the add result dialog is open (irrespective of the method the dialog was opened) ?

Or is it possible that TestRail could be updated to pass data containing the test_id on the ‘result_dialog.loaded’ event ?