Skip to content

Commit

Permalink
Add 6 new conditions for step execution
Browse files Browse the repository at this point in the history
  • Loading branch information
bcivel committed Aug 15, 2024
1 parent c004c4c commit 0a2b34f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ <h5 class="modal-title">Options</h5>
<label class="conditionVal3Label">Step Condition Parameter</label>
<input class="form-control input-sm" id="stepConditionVal3">
</div>
<div class="col-lg-9 form-group v4">
<label class="conditionVal4Label">stepconditionval4</label>
<select class="form-control input-sm" id="stepconditionval4"></select>
</div>
</div>
</div>
</div>
Expand Down
20 changes: 19 additions & 1 deletion source/src/main/webapp/js/pages/TestCaseScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,6 @@ function duplicateStep(event) {

function appendActionsForConditionCombobox(combo, operator){

console.log(combo);
combo.empty();
var steps = $("#steps li").data("item").steps;
for (s in steps) {
Expand Down Expand Up @@ -2278,12 +2277,26 @@ function displayStepOptionsModal(step, htmlElement) {
$("#stepConditionVal2").val(step.conditionValue2);
$("#stepConditionVal3").val(step.conditionValue3);
setPlaceholderCondition($("#stepConditionOperator"));
if (conditionNewUIList[step.conditionOperator].type ==="combo") {
appendActionsForConditionCombobox($("#stepconditionval4"), step.conditionOperator);
if (conditionNewUIList[step.conditionOperator].level ==="step"){
$("#stepconditionval4").val(step.conditionValue1);
}
if (conditionNewUIList[step.conditionOperator].level ==="action"){
$("#stepconditionval4").val(step.conditionValue1+"-"+step.conditionValue2);
}
if (conditionNewUIList[step.conditionOperator].level ==="control"){
$("#stepconditionval4").val(step.conditionValue1+"-"+step.conditionValue2+"-"+step.conditionValue3);
}
}

//END OF CONDITION

$("#stepConditionOperator").off("change");
$("#stepConditionOperator").on("change", function () {
setModif(true);
setPlaceholderCondition($(this));
appendActionsForConditionCombobox($("#stepconditionval4"), $(this).val());
});
$("#stepConditionVal1").off("change");
$("#stepConditionVal1").on("change", function () {
Expand Down Expand Up @@ -2353,6 +2366,11 @@ function displayStepOptionsModal(step, htmlElement) {
step.conditionValue1 = $("#stepConditionVal1").val();
step.conditionValue2 = $("#stepConditionVal2").val();
step.conditionValue3 = $("#stepConditionVal3").val();
if (conditionNewUIList[step.conditionOperator].type === "combo") {
step.conditionValue1 = $("#stepconditionval4 option:selected").attr("stepId");
step.conditionValue2 = $("#stepconditionval4 option:selected").attr("actionId") === undefined ? "":$("#stepconditionval4 option:selected").attr("actionId");
step.conditionValue3 = $("#stepconditionval4 option:selected").attr("controlId")=== undefined ? "":$("#stepconditionval4 option:selected").attr("controlId");
}
step.loop = $("#stepLoop").val();


Expand Down

0 comments on commit 0a2b34f

Please sign in to comment.