Skip to content

Commit

Permalink
#2463 added backgrounds on manuel test report
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas HIMPENS committed Apr 18, 2023
1 parent 7ec6b99 commit 59cf9b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
8 changes: 4 additions & 4 deletions source/src/main/webapp/css/pages/TestCaseExecution.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@
color: #555;
}

.itemStatusOK, .itemStatusOK:not(:focus) {
.stepStatusOK, .stepStatusOK:not(:focus) {
background-color: var(--crb-green-light-color);
}

.itemStatusFA, .itemStatusFA:not(:focus) {
.stepStatusFA, .stepStatusFA:not(:focus) {
background-color: var(--crb-orange-light-color);
}

.itemStatusKO, .itemStatusKO:not(:focus) {
.stepStatusKO, .stepStatusKO:not(:focus) {
background-color: var(--crb-red-light-color);
}

Expand All @@ -202,7 +202,7 @@
background-color: var(--crb-red-light-color) !important;
}

.itemStatusOK:hover, .itemStatusnFA:hover, .itemStatusKO:hover {
.stepStatusOK:hover, .stepStatusFA:hover, .stepStatusKO:hover, .itemStatusOK:hover, .itemStatusFA:hover, .itemStatusKO:hover {
background-color: #f5f5f5 !important;
}

Expand Down
18 changes: 15 additions & 3 deletions source/src/main/webapp/js/pages/TestCaseExecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -2198,15 +2198,15 @@ Step.prototype.draw = function () {

if (object.returnCode === "OK") {
htmlElement.prepend($('<span class="label label-primary labelGreen optionLabel pull-left"><span class="glyphicon glyphicon-ok"></span></span>'));
htmlElement.addClass("itemStatusOK");
htmlElement.addClass("stepStatusOK");
} else if (object.returnCode === "FA") {
htmlElement.prepend($('<span class="label label-primary labelOrange optionLabel pull-left"><span class="glyphicon glyphicon-alert"></span></span>'));
htmlElement.addClass("itemStatusFA");
htmlElement.addClass("stepStatusFA");
} else if (object.returnCode === "PE") {
htmlElement.prepend($('<span class="label label-primary labelBlue optionLabel pull-left"><span class="glyphicon glyphicon-refresh spin"></span></span>'));
} else if (object.returnCode === "KO") {
htmlElement.prepend($('<span class="label label-primary labelRed optionLabel pull-left"><span class="glyphicon glyphicon-remove"></span></span>'));
htmlElement.addClass("itemStatusKO");
htmlElement.addClass("stepStatusKO");
} else if (object.returnCode === "NA") {
htmlElement.prepend($('<span class="label label-primary labelYellow optionLabel pull-left"><span class="glyphicon glyphicon-alert"></span></span>'));
} else if (object.returnCode === "NE") {
Expand Down Expand Up @@ -2663,16 +2663,22 @@ function triggerActionExecution(element, id, status) {

// update element checked
if (status === "OK") {
$(element).parents(".action-group").removeClass("itemStatusFA itemStatusKO");
$(element).parents(".action-group").addClass("itemStatusOK");
$(element).parents(".action-group").find(".status").find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-ok pull-left");
$(element).parents(".action-group").find(".status").find("span.label").removeClass().addClass("label label-primary labelGreen optionLabel pull-left");
$(element).parents(".action-group").find("input[name='returncode']").val("OK").change();
newReturnCode = "OK";
} else if (status === "FA") {
$(element).parents(".action-group").removeClass("itemStatusOK itemStatusKO");
$(element).parents(".action-group").addClass("itemStatusFA");
$(element).parents(".action-group").find(".status").find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-alert pull-left");
$(element).parents(".action-group").find(".status").find("span.label").removeClass().addClass("label label-primary labelOrange optionLabel pull-left");
$(element).parents(".action-group").find("input[name='returncode']").val("FA").change();
newReturnCode = "FA";
} else if (status === "KO") {
$(element).parents(".action-group").removeClass("itemStatusOK itemStatusFA");
$(element).parents(".action-group").addClass("itemStatusKO");
$(element).parents(".action-group").find(".status").find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-remove pull-left");
$(element).parents(".action-group").find(".status").find("span.label").removeClass().addClass("label label-primary labelRed optionLabel pull-left");
$(element).parents(".action-group").find("input[name='returncode']").val("KO").change();
Expand Down Expand Up @@ -2716,6 +2722,8 @@ function triggerActionExecution(element, id, status) {
if (returnCodes.includes("KO")) {
$($(".stepItem")[i]).find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-remove pull-left");
$($(".stepItem")[i]).find("span.label").removeClass().addClass("label label-primary labelRed optionLabel pull-left");
$($(".stepItem")[i]).removeClass("stepStatusOK stepStatusFA");
$($(".stepItem")[i]).addClass("stepStatusKO");
testCaseNewReturnCode = "KO";
if (typeof $($(".stepItem")[i]).data("item") !== 'undefined') {
$($(".stepItem")[i]).data("item").returnCode = testCaseNewReturnCode;
Expand All @@ -2725,6 +2733,8 @@ function triggerActionExecution(element, id, status) {
} else if (returnCodes.includes("FA")) {
$($(".stepItem")[i]).find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-alert pull-left");
$($(".stepItem")[i]).find("span.label").removeClass().addClass("label label-primary labelOrange optionLabel pull-left");
$($(".stepItem")[i]).removeClass("stepStatusOK stepStatusKO");
$($(".stepItem")[i]).addClass("stepStatusFA");
testCaseNewReturnCode = "FA";
if (typeof $($(".stepItem")[i]).data("item") !== 'undefined') {
$($(".stepItem")[i]).data("item").returnCode = testCaseNewReturnCode;
Expand All @@ -2734,6 +2744,8 @@ function triggerActionExecution(element, id, status) {
} else {
$($(".stepItem")[i]).find("span.glyphicon").removeClass().addClass("glyphicon glyphicon-ok pull-left");
$($(".stepItem")[i]).find("span.label").removeClass().addClass("label label-primary labelGreen optionLabel pull-left");
$($(".stepItem")[i]).removeClass("stepStatusKO stepStatusFA");
$($(".stepItem")[i]).addClass("stepStatusOK");
testCaseNewReturnCode = "OK";
if (typeof $($(".stepItem")[i]).data("item") !== 'undefined') {
$($(".stepItem")[i]).data("item").returnCode = testCaseNewReturnCode;
Expand Down

0 comments on commit 59cf9b3

Please sign in to comment.