From 20a6f9842cf0d0524ac20524572979860a93788d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Fern=C3=A1ndez=20de=20la=20Cigo=C3=B1a=20N=C3=B3vo?= =?UTF-8?q?a?= Date: Mon, 19 Sep 2011 18:45:52 +0200 Subject: [PATCH] Added new test file with include some tests for project planning and assign a labels in a task new file: scripts/functional-tests/scheduling/planning_labels_test.sah FEA: ItEr75S26SchedulingTests --- .../scheduling/planning_labels_test.sah | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 scripts/functional-tests/scheduling/planning_labels_test.sah diff --git a/scripts/functional-tests/scheduling/planning_labels_test.sah b/scripts/functional-tests/scheduling/planning_labels_test.sah new file mode 100644 index 000000000..66600c031 --- /dev/null +++ b/scripts/functional-tests/scheduling/planning_labels_test.sah @@ -0,0 +1,103 @@ +/* + * 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 . + */ + +/* 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(){ + _doubleClick(_span("z-dottree-ico z-dottree-firstspacer")); + _click(_span("Labels")); + _click(_italic(0, _span("Assign Label[1]"))); + _click(_div("High")); + _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(){ + _click(_cell("Project Scheduling")); + _click(_image("ico_labels.png")); + planningCheckAssignedValidation(); + _log("Check if the labels are showed", "custom1"); +} + +function planningCheckLabelFilter($label, $labelName){ + _click(_italic(0, _near(_span("with")))); + _click(_div($labelName+" ( "+$label+" )")); + _click(_cell("Filter")); + planningCheckLabelFilterValidation(); + _log("Check if the labels are filtered", "custom1"); +} + +function deleteRequiredElements(){ + commonDeleteProject($projectName); + commonLabelDelete($label); + _log("Delete required elements", "custom1"); +} + +/* + * Validations + */ + +function planningCheckAssignedValidation(){ + _assertExists(_div("High")); + _assert(_isVisible(_div("High"))); +} + +function planningCheckLabelFilterValidation(){ + _assertNotTrue(_isVisible(_span("z-tree-ico z-tree-firstspacer[1]"))); +} + +/* test values */ + +var $label = "Experience"; +var $labelList = ["High", "Low"]; +var $projectName = "ProjectForPlannigLabels"; +var $taskName = "taskForPlanningLabels"; +var $taskName2 = "taskForPlanningLabels2"; + +/* test actions */ + +commonLogin("admin", "admin"); + +commonLabelCreate($label, $labelList); +commonCreateProject($projectName); +commonCreateTask($projectName, $taskName, "12"); +commonCreateTask($projectName, $taskName2, "24"); +commonEditProject($projectName); +planningAssignLabel(); +planningCheckLabel(); +planningCheckLabelFilter($label, $labelList[0]); +deleteRequiredElements(); + +commonLogout();