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

Tests.change event in version 5.0


#1

I have a script that subscribes to the tests.changed event to advance to the next test case automatically. I noticed that the event is not firing after updating to version 5.0.
Is there a new event that should be used to auto-advance the test case after entering a result?

Thanks


#2

Hi!

Could you post a snippet with the relevant code to reproduce this? The tests.changed event hasn’t changed and I’m happy to look into this.

Cheers,
Tobias


#3

Previously after entering a test result, this block would move to the next test case.

$.subscribe(‘tests.changed’, ‘move_to_next’, function (data) {
var testId = uiscripts.context.test.id;
App.Tests.loadNext(testId);
});


#4

Thanks for that! We will make sure to review this. Just to confirm: this is for the test page (the one with the next/previous buttons), is this correct? Do you see a JavaScript error in the developer console of your browser?

Cheers,
Tobias


#5

Correct, from the test page I hit “Add Result” then I add the result and hit “Add Result” Button. The result is added and normally the script will send me to the next test case in the current run. However, nothing happens after upgrading to version 5.0.

No errors showing in the console. I added console.log statements to the script and verified the script is getting ran. However, it never makes it inside the “subscribe” block where I added the second console.log statement.


#6

We could now review this in detail and can confirm the behavior. The next version of TestRail (5.0.1, likely available next week) adds a new results.added event specifically for this purpose. The code would then look as follows:

$.subscribe('results.added', 'move_to_next', function (data) {
    App.Tests.loadNext(data.test_id);
});

Thanks again for reporting this issue and please let me know in case you have any questions!

Cheers,
Tobias