Test Management 2.0: Collect Actual Result, attachments, and comments on a Pass Test Step

SusanWinKY
Kilo Sage

We've been asked to allow a tester to provide actual results, attachments, and comments on a Pass test step in Test Management 2.0 similar to how this can be done for a Failed or Blocked test step in TM 2.0. Has anyone managed to customize this?

We've submitted an Idea for this (that represents a couple of ideas that were closed as "Unlikely to implement") but can no longer wait for this to be developed into the product.  We need to build it ourselves.  We'd appreciate any advice you can give us. Thanks.


Susan Williams, Lexmark
6 REPLIES 6

Frank67
Tera Expert

Yes, we did this as part of a bunch of reluctant customizations we had to undertake to make Test Mgt 2.0 workable, three years ago now.  Waiting ever since for enhancements.  Not a thing. I too had a bunch of ideas, or upvoted a bunch of other folks' ideas, to make Test Mgt 2.0 useful for our testers, like even just bringing across some of the functionality they had in the original Test Management, and all have been closed due to time expiry which is super frustrating.  Every new release I scour the notes looking for Test Mgt 2.0 improvements but it gets no love from ServiceNow. Even with our customizations it is onerous, and our test team still does a lot of work outside ServiceNow, which is not how it is supposed to work.  Anyway we basically copied the functionality from the block or fail, it wasn't too hard for our dev to make it all the same. 

Chris Everding
ServiceNow Employee
ServiceNow Employee

Hi Susan,

This can be done easily enough, all changes will be made in the test_step_result UI Macro.

You'll need to - 

  1. Add a new style to show the green bar/sideline down the left similar to the red/orange displayed for blocked and failed (optional)
  2. update the part of the code that adds the comment and attachment functionality to be displayed when the result.step_result_value ==='passed'
  3. Right down the bottom add the new style to the step_result_sideline for when the result_value is passed (optional)

Hope this helps.

Chris

Hi @Chris Everding 

 

As per the above steps mentioned by you i did the cahnges but its not working.Please find the attached code fot the same

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
    <g:requires name="scripts/angular_includes_1.5.11.js" />
    <g:requires name="scripts/app.test_management/test-step-result/js_includes_test_step_result.js" includes="true" params="r=$[new global.AgileGlobalUtils().getFlushStamp('jsjsjscache')]"/>
    <g:requires name="styles/app.test_management/test-step-result.css" params="c=$[gs.getProperty('css.version')]_$[new TestManagementGlobalUtils().getFlushStamp('csscsscsscache')]&amp;theme=${jvar_theme}"/>
    <g2:evaluate var="jvar_step_results" object="true">
        new TestStepResultService().getStepResults('$[current.getUniqueValue()]');
    </g2:evaluate>
    <now-message key="File not downloaded" value="${gs.getMessage('The file {0} did not pass security scan and cannot be downloaded.')}"></now-message>
    <div class="sn_step_result" ng-cloak="" sn-ng-formatter="sn.testManagement.testStepResult" id="testStepResultApp" ng-controller="TestStepResultCtrl as vm">
        <script>
            angular.module("sn.testManagement.testStepResult").run(function(dataStore){
                dataStore.setData("testStepResults",JSON.parse("$[JS:jvar_step_results]"));
            });
        </script>
        <div>
            <div class=" col-xs-12 col-md-1_5 col-lg-2 control-label">$[SP]</div>
        </div>
        <div class="col-xs-10 col-md-9 col-lg-8 form-field input_controls">
            <ul class="step_result_list">
                <li class="flex flex-column" ng-repeat="result in vm.stepResults">
                    <div class="step_result_content row">
                        <div class="word-break col-xs-9" aria-label="${gs.getMessage('Test step')}: {{::result.step}}" tabindex="0">{{::result.step}}</div>
                        <div ng-if="::result.step_result" class="col-xs-3">
                            <div class="flex flex-v-center step-result" aria-label="${gs.getMessage('Step result')}: {{::result.step_result}}" tabindex="0">
                                <span>{{::result.step_result}}</span>
                                <span ng-if="::result.step_result" class="icon-circle-solid flex flex-h-center flex-v-center" ng-class="::{'test-passed': result.step_result_value === 'passed', 'test-failed': result.step_result_value === 'failed', 'test-blocked': result.step_result_value === 'blocked', 'text-dark': result.step_result_value === 'not_executed'}"></span>
                            </div>
                        </div>
                    </div>
                    <div ng-if="::result.step_result_value === 'passed' ||result.step_result_value === 'failed' || result.step_result_value === 'blocked'">
                        <div class="step_result_comment_container" ng-if="result.comment">
                            <div class="step_result_comment_label">${gs.getMessage('Comment')}</div>
                            <div class="step_result_comment word-break" tabindex="0" aria-label="{{::result.comment}}">{{::result.comment}}</div>
                        </div>
                        <div class="step_result_attachment_container">
                            <ul>
                                <li class="step_attachment_item flex flex-v-center" ng-repeat="file in result.files track by file.sys_id" ng-click="vm.handleAttachmentClick($event,file)" ng-class="::{'infected_file': file.state === 'not_available'}">
                                   <div class="step_attachment_preview flex flex-v-center flex-h-center">
                                       <span class="step_attachment_image" ng-if="::file.image" ng-style="::{'background-image': 'url(' + file.thumbSrc + ')'}" />
                                        <span class="step_attachment_icon" ng-if="::!file.image" ng-switch="" on="file.ext">
                                            <span ng-switch-when="pdf" class="icon-document-pdf"></span>
                                            <span ng-switch-when="doc" class="icon-document-doc"></span>
                                            <span ng-switch-when="docx" class="icon-document-doc"></span>
                                            <span ng-switch-when="ppt" class="icon-document-ppt"></span>
                                            <span ng-switch-when="txt" class="icon-document-txt"></span>
                                            <span ng-switch-when="xls" class="icon-document-xls"></span>
                                            <span ng-switch-when="zip" class="icon-document-zip"></span>
                                            <span ng-switch-default="" class="icon-document"></span>
                                        </span>
                                    </div>
                                    <div class="flex flex-1 flex-v-center step_attachment_detail_container">
                                        <div class="flex flex-1 flex-column step_attachment_detail">
                                            <div class="flex-ellipsis"><span aria-label="${gs.getMessage('File name')}" class="step_attachment_file_name" title="{{::file.file_name}}" tabindex="0">{{::file.file_name}}</span>
                                                <span ng-if="::file.state === 'not_available'">$[SP][${gs.getMessage('Unavailable')}]</span>
                                            </div>
                                            <div class="step_attachment_file_size" aria-label="${gs.getMessage('File size')}" tabindex="0">{{::file.size}}</div>
                                        </div>
                                        <div>
                                            <a ng-if="::file.state !== 'not_available'" ng-click="$event.stopPropagation();" ng-href="{{vm.getDownloadLink(file)}}" class="btn btn-icon icon-download flex flex-h-center flex-v-center" title="${gs.getMessage('Download')}"></a>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="step_result_sideline" ng-class="::{'step-passed': result.step_result_value === 'passed','step-failed': result.step_result_value === 'failed', 'step-blocked': result.step_result_value === 'blocked'}"></div>
                </li>
            </ul>
        </div>
        <div class="col-xs-2 col-md-1_5 col-lg-2 form-field-addons">
        </div>
    </div>
</j:jelly>
 
Thanks in advance
 

 

 

 

Hi @Kumari Divya,

 

Is the script above the new version with your changes? Can you highlight the parts you've changed please?

 

Thanks,

Chris