Fix account functional tests
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
5bb6aeb9d1
commit
8859dafb84
5 changed files with 34 additions and 34 deletions
|
|
@ -68,7 +68,7 @@ function passwordStandarUserValidation(){
|
|||
*/
|
||||
|
||||
function commonUserCreate($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
commonUserForm($name, $password);
|
||||
commonSaveValidation("User", $name);
|
||||
_log("Create a new Account", "custom1");
|
||||
|
|
@ -82,8 +82,8 @@ function commonUserForm($name, $password) {
|
|||
}
|
||||
|
||||
function commonUserEdit($name, $password){
|
||||
_click(_link("Accounts"));
|
||||
commonEdit($name, 4);
|
||||
_click(_link("User Accounts"));
|
||||
commonEdit($name, 5);
|
||||
_setValue(_password(0, _near(_span("Password"))), $password);
|
||||
_setValue(_password(0, _near(_span("Password confirmation"))), $password);
|
||||
_click(_cell("Save"));
|
||||
|
|
@ -91,7 +91,7 @@ function commonUserEdit($name, $password){
|
|||
}
|
||||
|
||||
function commonUserDelete($user){
|
||||
commonDelete("Accounts", $user, 4);
|
||||
commonDelete("User Accounts", $user, 5);
|
||||
commonDeleteValidation("User", $user);
|
||||
_log("Delete the user", "custom1");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function settingsCreateRequiredElements(){
|
|||
}
|
||||
|
||||
function settingsPressCheckboxes($list, $press){
|
||||
_click(_link("Settings"));
|
||||
_click(_link("Preferences"));
|
||||
if ($press == "yes"){
|
||||
for (var $i = 0; $i < $list.length; $i++){
|
||||
if (_condition(_checkbox(0, _near(_label($list[$i]))).checked == false)){
|
||||
|
|
@ -55,7 +55,7 @@ function settingsPressCheckboxes($list, $press){
|
|||
}
|
||||
|
||||
function settingsCheckChartsExpanded($expanded){
|
||||
_click(_link("Projects Planning"));
|
||||
_click(_link("Company view"));
|
||||
if ($expanded == "yes"){
|
||||
settingCheckExists();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ _include("../common_functions.sah");
|
|||
*/
|
||||
|
||||
function configChangeInCheckboxes($list) {
|
||||
_click(_link("LibrePlan Configuration"));
|
||||
_click(_link("Main Settings"));
|
||||
configPressCheckboxes($list);
|
||||
_click(_cell("Save"));
|
||||
configSaveValidation();
|
||||
|
|
@ -73,7 +73,7 @@ function configCheckMonteCarlo(){
|
|||
_assertExists(_cell("MonteCarlo Method"));
|
||||
_assert(_isVisible(_cell("MonteCarlo Method")));
|
||||
_log("Monte Carlo is showed", "custom1");
|
||||
_click(_link("LibrePlan Configuration"));
|
||||
_click(_link("Main Settings"));
|
||||
_click(_checkbox(0, _near(_label("MonteCarlo method"))));
|
||||
_click(_cell("Save"));
|
||||
commonDeleteProject("projectForCheckMontecarlo");
|
||||
|
|
@ -116,20 +116,20 @@ function configCheckMaterial(){
|
|||
}
|
||||
|
||||
function configCheckWorkReport(){
|
||||
_click(_link("LibrePlan Configuration"));
|
||||
_click(_checkbox(0, _near(_label("Work report types"))));
|
||||
_click(_link("Main Settings"));
|
||||
_click(_checkbox(0, _near(_label("Timesheet templates"))));
|
||||
_click(_cell("Save"));
|
||||
commonWorkReportModelCreate("modelForConfiguration", "line")
|
||||
configCheckWorkReportCreate();
|
||||
commonWorkReportModelDelete("modelForConfiguration");
|
||||
_click(_link("LibrePlan Configuration"));
|
||||
_click(_checkbox(0, _near(_label("Work report types"))));
|
||||
_click(_link("Main Settings"));
|
||||
_click(_checkbox(0, _near(_label("Timesheet templates"))));
|
||||
_click(_cell("Save"));
|
||||
}
|
||||
|
||||
function configCheckWorkReportCreate(){
|
||||
var $code;
|
||||
_click(_cell("New work report"));
|
||||
_click(_cell("New timesheet"));
|
||||
_click(_cell("Add new row"));
|
||||
_set($code, _textbox(0, _near(_span("Code"))).value);
|
||||
if ($code == ""){
|
||||
|
|
@ -165,7 +165,7 @@ function configChangeCalendar($name){
|
|||
}
|
||||
|
||||
function configChangeCalendarOption($name){
|
||||
_click(_link("LibrePlan Configuration"));
|
||||
_click(_link("Main Settings"));
|
||||
_click(_italic(0, _near(_span("Default calendar"))));
|
||||
_click(_div($name));
|
||||
_click(_cell("Save"));
|
||||
|
|
@ -199,11 +199,11 @@ function configCheckCalendarProject($name){
|
|||
}
|
||||
|
||||
/* test values */
|
||||
var $listCheckoxes = ["Criterion", "Label", "Work report", "Resources", "Types of work hours",
|
||||
"Material categories", "Unit Measures", "Calendar", "Work report types",
|
||||
"Calendar exception types", "Cost category", "MonteCarlo method", "Enable/Disable"];
|
||||
var $listMenuOptions = ["Criteria", "Exception Days", "Labels", "Unit Measures", "Work Hours",
|
||||
"Work Report Models", "Cost Categories", "Calendars", "Workers", "Machines"];
|
||||
var $listCheckoxes = ["Criteria", "Labels", "Timesheets", "Resources", "Hours Types",
|
||||
"Material categories", "Material Units", "Calendar", "Timesheet templates",
|
||||
"Calendar exception days", "Cost category", "Expense sheeets", "MonteCarlo method"];
|
||||
var $listMenuOptions = ["Criteria", "Calendar Exception Days", "Labels", "Material Units", "Hours Types",
|
||||
"Timesheets Templates", "Cost Categories", "Calendars", "Workers", "Machines"];
|
||||
var $calendarName = "CalendarForConfig";
|
||||
|
||||
/* test actions */
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ function profileEditForm($name) {
|
|||
}
|
||||
|
||||
function profileAssign($account, $password, $profile){
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($account, $password, $profile);
|
||||
profileTryDelete($profile);
|
||||
commonDelete("Accounts", $account, 4);
|
||||
commonDelete("User Accounts", $account, 5);
|
||||
_log("Assign the profile to a account", "custom1");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,28 +39,28 @@
|
|||
_include("../common_functions.sah");
|
||||
|
||||
function accountsCreate($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($name, $password);
|
||||
commonSaveValidation("User", $name);
|
||||
_log("Create a new Account", "custom1");
|
||||
}
|
||||
|
||||
function accountsCreateTwoUserSamePass($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($name, $password);
|
||||
commonSaveValidation("User", $name);
|
||||
_log("Create a new Account same password", "custom1");
|
||||
}
|
||||
|
||||
function accountsCreateDuplicateType($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($name, $password);
|
||||
accountsNotValid($name);
|
||||
_log("Do not allow create an Account Duplicate", "custom1");
|
||||
}
|
||||
|
||||
function accountsCreateEmpty($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($name, $password);
|
||||
_assertExists(_div("cannot be empty"));
|
||||
_assert(_isVisible(_div("cannot be empty")));
|
||||
|
|
@ -68,14 +68,14 @@ function accountsCreateEmpty($name, $password) {
|
|||
}
|
||||
|
||||
function accountsCreateTwoUserSamePass($name, $password) {
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
accountsForm($name, $password);
|
||||
commonSaveValidation("User", $name);
|
||||
_log("Create a new Account same password", "custom1");
|
||||
}
|
||||
|
||||
function accountsCreateTwoPass($name, $password, $newPassword){
|
||||
commonCreate("Accounts");
|
||||
commonCreate("User Accounts");
|
||||
_setValue(_textbox(0, _near(_span("Username"))), $name);
|
||||
_setValue(_password(0, _near(_span("Password"))), $password);
|
||||
_setValue(_password(0, _near(_span("Password confirmation"))), $newPassword);
|
||||
|
|
@ -104,7 +104,7 @@ function accountsComprobateUser($name, $Password) {
|
|||
}
|
||||
|
||||
function accountsEdit($oldName, $newName, $newPassword, $cell) {
|
||||
_click(_link("Accounts"));
|
||||
_click(_link("User Accounts"));
|
||||
commonEdit($oldName, $cell);
|
||||
_setValue(_textbox(0, _near(_span("Username"))), $newName);
|
||||
_setValue(_password(0, _near(_span("Password"))), $newPassword);
|
||||
|
|
@ -121,12 +121,12 @@ function accountsComprobateNoUser($name, $Password){
|
|||
}
|
||||
|
||||
function accountsNoAdmin(){
|
||||
_assertNotExists(_link("Accounts"));
|
||||
_assertNull(_link("Accounts"));
|
||||
_assertNotExists(_link("User Accounts"));
|
||||
_assertNull(_link("User Accounts"));
|
||||
}
|
||||
|
||||
function accountsAdminYes(){
|
||||
_assertExists(_link("Accounts"));
|
||||
_assertExists(_link("User Accounts"));
|
||||
}
|
||||
|
||||
function accountsNoValidationLogin(){
|
||||
|
|
@ -158,7 +158,7 @@ accountsCreateDuplicateType($user, $password);
|
|||
accountsCreateEmpty("", $password);
|
||||
accountsCreateTwoPass($user, $password, $newPassword);
|
||||
|
||||
accountsEdit($user, $newUser, $newPassword, 4);
|
||||
accountsEdit($user, $newUser, $newPassword, 5);
|
||||
accountsComprobateUser( $newUser, $newPassword);
|
||||
accountsAdminYes();
|
||||
_log("Comprobate Account with Administrator rights", "custom1");
|
||||
|
|
@ -181,10 +181,10 @@ _log("Comprobate Account with fake user and password", "custom1");
|
|||
|
||||
commonLogin("admin", "admin");
|
||||
|
||||
commonDelete("Accounts", $newUser, 4);
|
||||
commonDelete("User Accounts", $newUser, 5);
|
||||
commonDeleteValidation("User", $newUser);
|
||||
_log("Delete an Account Duplicate", "custom1");
|
||||
commonDelete("Accounts", $user2, 4);
|
||||
commonDelete("User Accounts", $user2, 5);
|
||||
commonDeleteValidation("User", $user2);
|
||||
_log("Delete an Account Duplicate", "custom1");
|
||||
commonLogout();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue