TASKPM/scripts/functional-tests/scheduling/planning_labels_test.sah
Pablo Fernández de la Cigoña Nóvoa 0687fc1eb8 Use some functions from common_functions.sah, in planning_labels_test.sah
FEA: ItEr75S26SchedulingTests
2011-09-23 12:01:18 +02:00

91 lines
2.7 KiB
Text

/*
* This file is part of NavalPlan
*
* Copyright (C) 2011 Igalia, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Included tests
*
* 1 - Create a Label
* 2 - Create a Project
* 3 - Create two tasks
* 4 - Assign the label to the first of the tasks
* 5 - Check that the label is showed when label button is pressed
* 6 - Filter the showed task by the the assigned label
* 7 - Check that just the task with the assigned label lis showed
* 8 - Delete required elements
*
*/
_include("../common_functions.sah");
function planningAssignLabel($label){
_doubleClick(_span("z-dottree-ico z-dottree-firstspacer"));
_click(_span("Labels"));
_click(_italic(0, _span("Assign Label[1]")));
_click(_div($label));
_click(_cell("z-button-cm", _near(_span("Assign Label[1]"))));
_click(_cell("Back"));
_click(_image("ico_save.png"));
_click(_cell("OK"));
_log("Assig the label in a task", "custom1");
}
function planningCheckLabel($label){
_click(_cell("Project Scheduling"));
_click(_image("ico_labels.png"));
planningCheckAssignedValidation($label);
_log("Check if the labels are showed", "custom1");
}
function deleteRequiredElements(){
commonDeleteProject($projectName);
commonLabelDelete($labelName);
_log("Delete required elements", "custom1");
}
/*
* Validations
*/
function planningCheckAssignedValidation($label){
_assertExists(_div($label));
_assert(_isVisible(_div($label)));
}
/* test values */
var $labelName = "Experience";
var $labelList = ["High", "Low"];
var $projectName = "ProjectForPlannigLabels";
var $taskName = "taskForPlanningLabels";
var $taskName2 = "taskForPlanningLabels2";
/* test actions */
commonLogin("admin", "admin");
commonLabelCreate($labelName, $labelList);
commonCreateProject($projectName);
commonCreateTask($projectName, $taskName, "12");
commonCreateTask($projectName, $taskName2, "24");
commonEditProject($projectName);
planningAssignLabel($labelList[0]);
planningCheckLabel($labelList[0]);
commonProjectPlanningFilter($labelName, $labelList[0]);
deleteRequiredElements();
commonLogout();