Include some functions from virtual_worker_test.sah in common_functions.sah
FEA: ItEr75S24ResourcesTests
This commit is contained in:
parent
def7885364
commit
5a42b3858b
2 changed files with 53 additions and 35 deletions
|
|
@ -184,6 +184,15 @@ function commmonResourceEmptyFields(){
|
||||||
_assert(_isVisible(_div("This field may not be empty or contain only spaces.")));
|
_assert(_isVisible(_div("This field may not be empty or contain only spaces.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function commonResourceFilter($resource, $criterion, $name){
|
||||||
|
_click(_link($resource));
|
||||||
|
_click(_italic(0, _near(_span("Filter by"))));
|
||||||
|
_click(_div($name+" ( "+$criterion+" )"));
|
||||||
|
_click(_cell("Filter"));
|
||||||
|
commonProjectPlanningFilterValidation();
|
||||||
|
_log("Create a criteria filter", "custom1");
|
||||||
|
}
|
||||||
|
|
||||||
function commonResourceEmptyCategoryName(){
|
function commonResourceEmptyCategoryName(){
|
||||||
_assertExists(_div("A category must be selected"));
|
_assertExists(_div("A category must be selected"));
|
||||||
_assert(_isVisible(_div("A category must be selected")));
|
_assert(_isVisible(_div("A category must be selected")));
|
||||||
|
|
@ -251,6 +260,39 @@ function commonMachineDelete($name){
|
||||||
_log("Delete the machine", "custom1");
|
_log("Delete the machine", "custom1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Common functions for Virtual Workers
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function commonVirtualWorkerCreate($name) {
|
||||||
|
commonVirtualWorkerGoToCreate();
|
||||||
|
commonVirtualWorkerForm($name);
|
||||||
|
commonVirtualWorkerAcctionValidation("saved");
|
||||||
|
_log("Create a new virtual worker", "custom1");
|
||||||
|
}
|
||||||
|
|
||||||
|
function commonVirtualWorkerGoToCreate (){
|
||||||
|
_click(_link("Virtual Workers Groups"));
|
||||||
|
_click(_cell("Create Virtual Worker"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function commonVirtualWorkerForm($name) {
|
||||||
|
_setValue(_textbox(0, _near(_span("Group name"))), $name);
|
||||||
|
_click(_cell("Save"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function commonVirtualWorkerDelete($name){
|
||||||
|
commonDelete("Virtual Workers Groups", $name, 3);
|
||||||
|
commonVirtualWorkerAcctionValidation("deleted");
|
||||||
|
_log("Delete the virtual worker", "custom1");
|
||||||
|
}
|
||||||
|
|
||||||
|
function commonVirtualWorkerAcctionValidation($action){
|
||||||
|
_assertExists(_span("Worker "+$action));
|
||||||
|
_assert(_isVisible(_span("Worker "+$action)));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Common functions for Companies
|
* Common functions for Companies
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -53,40 +53,23 @@
|
||||||
*/
|
*/
|
||||||
_include("../common_functions.sah");
|
_include("../common_functions.sah");
|
||||||
|
|
||||||
function virtualWorkerCreate($name) {
|
|
||||||
virtualWorkerGoToCreate();
|
|
||||||
virtualWorkerForm($name);
|
|
||||||
virtualWorkerAcctionValidation("saved");
|
|
||||||
_log("Create a new virtual worker", "custom1");
|
|
||||||
}
|
|
||||||
|
|
||||||
function virtualWorkerCreateDuplicateType($name) {
|
function virtualWorkerCreateDuplicateType($name) {
|
||||||
virtualWorkerGoToCreate();
|
commonVirtualWorkerGoToCreate();
|
||||||
virtualWorkerForm($name);
|
commonVirtualWorkerForm($name);
|
||||||
virtualWorkerNotValid($name);
|
virtualWorkerNotValid($name);
|
||||||
_log("Create a duplicate virtual worker", "custom1");
|
_log("Create a duplicate virtual worker", "custom1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function virtualWorkerCreateEmpty($name) {
|
function virtualWorkerCreateEmpty($name) {
|
||||||
virtualWorkerGoToCreate();
|
commonVirtualWorkerGoToCreate();
|
||||||
virtualWorkerForm("");
|
commonVirtualWorkerForm("");
|
||||||
_log("Create a empty virtual worker", "custom1");
|
_log("Create a empty virtual worker", "custom1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function virtualWorkerGoToCreate (){
|
|
||||||
_click(_link("Virtual Workers Groups"));
|
|
||||||
_click(_cell("Create Virtual Worker"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function virtualWorkerForm($name) {
|
|
||||||
_setValue(_textbox(0, _near(_span("Group name"))), $name);
|
|
||||||
_click(_cell("Save"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function virtualWorkerEdit($oldName, $newName, $cell) {
|
function virtualWorkerEdit($oldName, $newName, $cell) {
|
||||||
commonEdit($oldName, $cell);
|
commonEdit($oldName, $cell);
|
||||||
virtualWorkerForm($newName);
|
commonVirtualWorkerForm($newName);
|
||||||
virtualWorkerAcctionValidation("saved");
|
commonVirtualWorkerAcctionValidation("saved");
|
||||||
_log("Edit a virtual worker", "custom1");
|
_log("Edit a virtual worker", "custom1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,8 +81,8 @@ function virtualWorkerCheckCode($name){
|
||||||
}
|
}
|
||||||
|
|
||||||
function virtualWorkerCreateWithoutCode($name){
|
function virtualWorkerCreateWithoutCode($name){
|
||||||
virtualWorkerGoToCreate();
|
commonVirtualWorkerGoToCreate();
|
||||||
virtualWorkerForm($name);
|
commonVirtualWorkerForm($name);
|
||||||
commonEmptyCodeValidation();
|
commonEmptyCodeValidation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,7 +108,7 @@ function virtualWorkerCheckAssignedCostCategory($workerName, $cell, $cCategory){
|
||||||
commonWorkHourCreate("HourForWorker", "12");
|
commonWorkHourCreate("HourForWorker", "12");
|
||||||
commonCostCategoryCreate($cCategory, "HourForWorker");
|
commonCostCategoryCreate($cCategory, "HourForWorker");
|
||||||
commonResourceEditAssignedCostCategoryForm("Virtual Workers Groups", $workerName, $cell, $cCategory);
|
commonResourceEditAssignedCostCategoryForm("Virtual Workers Groups", $workerName, $cell, $cCategory);
|
||||||
virtualWorkerAcctionValidation("saved");
|
commonVirtualWorkerAcctionValidation("saved");
|
||||||
_log("Assign the created cost category", "custom1");
|
_log("Assign the created cost category", "custom1");
|
||||||
commonCostCategoryTryDeleteAssignedCostCategory($cCategory, 3);
|
commonCostCategoryTryDeleteAssignedCostCategory($cCategory, 3);
|
||||||
}
|
}
|
||||||
|
|
@ -170,11 +153,6 @@ function virtualWorkerNotValid($worker){
|
||||||
_assert(_isVisible(_span("checkConstraintUniqueVirtualGroupName: Virtual worker group name must be unique")));
|
_assert(_isVisible(_span("checkConstraintUniqueVirtualGroupName: Virtual worker group name must be unique")));
|
||||||
}
|
}
|
||||||
|
|
||||||
function virtualWorkerAcctionValidation($action){
|
|
||||||
_assertExists(_span("Worker "+$action));
|
|
||||||
_assert(_isVisible(_span("Worker "+$action)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* test values */
|
/* test values */
|
||||||
var $workerName = "new";
|
var $workerName = "new";
|
||||||
var $workerSurName = "newSon";
|
var $workerSurName = "newSon";
|
||||||
|
|
@ -189,15 +167,13 @@ var $projectName = "projectForVirtual";
|
||||||
/* test actions */
|
/* test actions */
|
||||||
commonLogin("admin", "admin");
|
commonLogin("admin", "admin");
|
||||||
|
|
||||||
virtualWorkerCreate($workerName, $workerSurName, $workerID);
|
commonVirtualWorkerCreate($workerName, $workerSurName, $workerID);
|
||||||
virtualWorkerCreateDuplicateType($workerName, $workerSurName, $workerID);
|
virtualWorkerCreateDuplicateType($workerName, $workerSurName, $workerID);
|
||||||
virtualWorkerCreateEmpty($workerName, $workerSurName, $workerID);
|
virtualWorkerCreateEmpty($workerName, $workerSurName, $workerID);
|
||||||
virtualWorkerEdit($workerName, $workerNewName, 3);
|
virtualWorkerEdit($workerName, $workerNewName, 3);
|
||||||
virtualWorkerCheckTabs();
|
virtualWorkerCheckTabs();
|
||||||
virtualWorkerCheckCode($workerName, $workerSurName, $workerID)
|
virtualWorkerCheckCode($workerName, $workerSurName, $workerID)
|
||||||
virtualWorkerAssignProject($projectName, $workerNewName);
|
virtualWorkerAssignProject($projectName, $workerNewName);
|
||||||
commonDelete("Virtual Workers Groups", $workerNewName, 3);
|
commonVirtualWorkerDelete($workerNewName);
|
||||||
virtualWorkerAcctionValidation("deleted");
|
|
||||||
_log("Delete the virtual worker", "custom1");
|
|
||||||
virtualWorkerDeleteRequiredElements();
|
virtualWorkerDeleteRequiredElements();
|
||||||
commonLogout();
|
commonLogout();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue