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

Change the Add Test Result default colour


#1

I have added a new overall Status for the Add Test Result window of “Incomplete”, which is coloured a light red. I have made this the default overall status, but the colour band at the top of the Add Test Result window remains green (the previous default of “Passed” colour) when first opening the window.

Changing the status to one of the other choices and then back to “Incomplete” forces the colour change, but I’m looking to have the default colour aligned when first opening the Add Test Result window. Any suggestions on how to achieve this?

Neil


#2

Hello Neil,

Thanks for your posting. Yes, this is supported and a UI script for this could look as follows:

[code]name: Changes the default status for Add Test Result dialog
description: Changes the default status for Add Test Result dialog
author: Gurock Software
version: 1.0
includes:
excludes:

js:
(document).ready( function() { .subscribe(‘result_dialog.loaded’, ‘uiscript’, function()
{
$(’#addResultStatus’).val(5);
App.Tests.setDialogColor(’#addResultDialog’, 5);
});
}
);
[/code]

With the ‘5’ being the ID of status you want to select by default. I hope this helps but please let me know in case you have any further questions.

Regards,
Tobias


#3

Thanks Tobias, changing the 5 to a 6 in both places in the script meant I got the customized status and colour I was after as a default. Thanks as always for the help.

Neil


#4

Hi Tobias,

I’ve just discovered an issue with this solution!

Previously, when editing a Test Result the Edit Test Result window displays the Overall Status (and the associated colour in the top bar) as the one in the already entered Test Result (and appropriate colour), e.g. Failed. How, however, the Edit Test Result window is showing my default Overall Status (Incomplete) and the associated default colour.

I do note that then saving the Edit Test Result window doesn’t change the originally entered status (Failed in the example), but it is very disconcerting to see the incorrect status showing in the popup before saving.

I look forward to a solution.

Neil


#5

Hello Neil,

Thanks for the update. Yes, this works as well and you can add a check for the disabled status dropdown as follows:

[code]name: Changes the default status for Add Test Result dialog
description: Changes the default status for Add Test Result dialog
author: Gurock Software
version: 1.0
includes:
excludes:

js:
(document).ready( function() { .subscribe(‘result_dialog.loaded’, ‘uiscript’, function()
{
if (!('#addResultStatus').attr('disabled')) { (’#addResultStatus’).val(7);
App.Tests.setDialogColor(’#addResultDialog’, 7);
}
});
}
);[/code]

Regards,
Tobias


#6

Thanks Tobias, again it worked for me when I changed the value to 6.

Neil


#7

Hi again,

The saga continues.

I have implemented the following UI script as discussed:

[code]name: Changes the default status for Add Test Result dialog
description: Changes the default status for Add Test Result dialog
author: Gurock Software
version: 1.0
includes:
excludes:

js:
(document).ready( function() { .subscribe(‘result_dialog.loaded’, ‘uiscript’, function()
{
if (!('#addResultStatus').attr('disabled')) { (’#addResultStatus’).val(6);
App.Tests.setDialogColor(’#addResultDialog’, 6);
}
});
}
);[/code]

And it fixes the issues described above, but I have another ancilliary issue whereby selecting Passed for a test step does not change the Overall status from my default starting status of Incomplete to Passed.

Selecting Failed for a test step does cause the Overall status to change to Failed, as expected.

Any further refinement of the script that could help me with this issue?

Neil


#8

Hi again Tobias, any thoughts to the above lingering issue?

Regards,
Neil


#9

Hello Neil,

Thanks for the update. I’ve now looked into this and this is currently the expected behavior. The overall status is only changed for the Failed status (when you set one/all steps to failed). This cannot be changed easily with a UI script unfortunately but we will look into it for one of the next versions.

Regards,
Tobias


#10

Thanks Tobias. When I gave it further thought I realized that was probably the situation. It’s not a big issue.

Regards,
Neil


#11

Alright, just let me know in case there’s anything else we can help with.

Regards,
Tobias