diff --git a/scripts/functional-tests/common_functions.sah b/scripts/functional-tests/common_functions.sah index 65658f932..cf2fa3940 100644 --- a/scripts/functional-tests/common_functions.sah +++ b/scripts/functional-tests/common_functions.sah @@ -394,11 +394,11 @@ function commonProgressDelete($name){ * Common functions for Criteria */ -function commonCriteriaCreate($type){ +function commonCriteriaCreate($type, $list){ commonCreate("Criteria"); - commonCriteriaForm($type); + commonCriteriaForm($type, $list); commonSaveValidation("Criterion Type", $type); - _log("Create a new criterion", "custom1"); + _log("Create criterion" + $type, "custom1"); } function commonCriteriaEdit($oldName, $newName, $cell){ @@ -410,13 +410,15 @@ function commonCriteriaEdit($oldName, $newName, $cell){ _log("Edit a criterion", "custom1"); } -function commonCriteriaForm($name){ +function commonCriteriaForm($name, $list){ _setValue(_textbox(0, _near(_span("Name"))), $name); _click(_checkbox(0, _near(_div("Multiple values per resource")))); _click(_checkbox(0, _near(_div("Hierarchy")))); _click(_cell("OK")); - _setValue(_textbox(0, _near(_span("New criterion"))), $name); - _click(_cell("Add")); + for (var $i = 0; $i < $list.length; $i++){ + _setValue(_textbox(0, _near(_span("New criterion"))), $list[$i]); + _click(_cell("Add")); + } _click(_cell("Save")); } diff --git a/scripts/functional-tests/resources/virtual_worker_test.sah b/scripts/functional-tests/resources/virtual_worker_test.sah index 6df85a208..d017b7784 100644 --- a/scripts/functional-tests/resources/virtual_worker_test.sah +++ b/scripts/functional-tests/resources/virtual_worker_test.sah @@ -110,7 +110,7 @@ function virtualWorkerCheckTabs(){ } function virtualWorkerCheckAssignedCriteria($workerName, $cell, $criterion){ - commonCriteriaCreate($criteriaName); + commonCriteriaCreate($criteriaName, [$criteriaName]); commonResourceEditAssignedCriteriaForm("Virtual Workers Groups", $workerName, $cell, $criterion); commonCriteriaTryDeleteAssigned($criteriaName); } diff --git a/scripts/functional-tests/resources/worker_test.sah b/scripts/functional-tests/resources/worker_test.sah index 8947709f6..bfaea34a4 100644 --- a/scripts/functional-tests/resources/worker_test.sah +++ b/scripts/functional-tests/resources/worker_test.sah @@ -105,7 +105,7 @@ function workerCheckTabs(){ } function workerCheckAssignedCriteria($workerName, $cell, $criterion){ - commonCriteriaCreate($criteriaName); + commonCriteriaCreate($criteriaName, [$criteriaName]); commonResourceEditAssignedCriteriaForm("Workers", $workerName, $cell, $criterion); commonCriteriaTryDeleteAssigned($criteriaName); } diff --git a/scripts/functional-tests/scheduling/planning_criteria_test.sah b/scripts/functional-tests/scheduling/planning_criteria_test.sah index 864c5afb9..a2a05e20c 100644 --- a/scripts/functional-tests/scheduling/planning_criteria_test.sah +++ b/scripts/functional-tests/scheduling/planning_criteria_test.sah @@ -141,7 +141,7 @@ var $taskName2 = "taskForPlanning2"; commonLogin("admin", "admin"); -commonCriteriaCreate($criterion); +commonCriteriaCreate($criterion, [$criterion]); commonCalendarCreate($calendar); commonWorkerCreate($workerName, $workerName, $workerName); commonResourceEditAssignedCriteriaForm("Workers", $workerName, 5, $criterion);