/* * This file is part of LibrePlan * * 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 . */ /* 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();