Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -121,7 +121,6 @@ Feature: Activity Resources Main Tests
|
||||
And the property "tas_assign_type" of "properties" is set to "<tas_assign_type>"
|
||||
And the property "tas_assign_variable" of "properties" is set to "<tas_assign_variable>"
|
||||
And the property "tas_group_variable" of "properties" is set to "<tas_group_variable>"
|
||||
And the property "tas_selfservice_timeout" of "properties" is set to <tas_selfservice_timeout>
|
||||
And the property "tas_selfservice_time" of "properties" is set to "<tas_selfservice_time>"
|
||||
And the property "tas_selfservice_time_unit" of "properties" is set to "<tas_selfservice_time_unit>"
|
||||
And the property "tas_transfer_fly" of "properties" is set to "<tas_transfer_fly>"
|
||||
|
||||
@@ -31,7 +31,7 @@ Feature: Files Manager Resources Main Tests
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 1 records
|
||||
And the response has 2 records
|
||||
|
||||
Scenario Outline: Create files and subfolders
|
||||
Given POST this data:
|
||||
@@ -99,12 +99,12 @@ Feature: Files Manager Resources Main Tests
|
||||
And the content type is "application/json"
|
||||
And the type is "<type>"
|
||||
|
||||
Examples:
|
||||
| test_description | prf_filename | prf_content | http_code | type | prf_number |
|
||||
| put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 |
|
||||
| put into mailtemplates folder | file_test_2.html | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 |
|
||||
| put into public subfolder | file_test_3 | put test | 200 | object | 2 |
|
||||
| put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 |
|
||||
Examples:
|
||||
| test_description | prf_filename | prf_content | http_code | type | prf_number |
|
||||
| put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 |
|
||||
| put into mailtemplates folder | file_test_2.html | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 |
|
||||
| put into public subfolder | file_test_3 | put test | 200 | object | 2 |
|
||||
| put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 |
|
||||
|
||||
|
||||
Scenario Outline: Get a single Files Manager and check some properties
|
||||
@@ -117,46 +117,67 @@ Feature: Files Manager Resources Main Tests
|
||||
And the "prf_path" property in row <row> equals "<prf_path>"
|
||||
And the "prf_content" property in row <row> equals "<prf_content>"
|
||||
|
||||
|
||||
Examples:
|
||||
| test_description | prf_filename | prf_content | http_code | type | prf_number | row | prf_path |
|
||||
| put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | 1 | public/ |
|
||||
| put into mailtemplates folder | file_test_2.html | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 | 1 | templates/ |
|
||||
| put into public subfolder | file_test_3.txt | put test | 200 | object | 2 | 0 | public/public_subfolder |
|
||||
| put into mailtemplates subfolder | file_test_4.html | put test | 200 | object | 3 | 0 | templates/templates_subfolder |
|
||||
Examples:
|
||||
| test_description | prf_filename | prf_content | http_code | type | prf_number | row | prf_path |
|
||||
| put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | 1 | public/ |
|
||||
| put into mailtemplates folder | file_test_2.html | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 | 1 | templates/ |
|
||||
| put into public subfolder | file_test_3.txt | put test | 200 | object | 2 | 0 | public/public_subfolder |
|
||||
| put into mailtemplates subfolder | file_test_4.html | put test | 200 | object | 3 | 0 | templates/templates_subfolder |
|
||||
|
||||
|
||||
Scenario Outline: Upload files to same folders
|
||||
Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1265557095225ff5c688f46031700471/file-manager"
|
||||
And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
|
||||
|
||||
Examples:
|
||||
| file | prf_path | prf_number |
|
||||
|/home/wendy/uploadfiles/test1.html | templates | 4 |
|
||||
|/home/wendy/uploadfiles/test2.html | templates | 5 |
|
||||
|/home/wendy/uploadfiles/test.txt | public | 6 |
|
||||
Examples:
|
||||
| file | prf_path | prf_number |
|
||||
|/home/wendy/uploadfiles/test1.html | templates | 4 |
|
||||
|/home/wendy/uploadfiles/test2.html | templates | 5 |
|
||||
|/home/wendy/uploadfiles/test.txt | public | 6 |
|
||||
|
||||
|
||||
Scenario: Upload files when the file already exists
|
||||
Given POST I want to upload the file "/home/wendy/uploadfiles/alert_message.html" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "already exists"
|
||||
Scenario: Upload files when the file already exists in the folder but with different content. must overwrite
|
||||
Given POST I want to upload the file "/home/wendy/uploadfiles/TestQA.html" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager"
|
||||
Then the response status code should be 200
|
||||
|
||||
|
||||
Scenario: Get a single Files Manager and check some properties the overwritten file
|
||||
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the "prf_filename" property in row 4 equals "TestQA.html"
|
||||
And the "prf_content" property in row 4 equals "Test QA - cuando se realiza la sobreescritura desde upload"
|
||||
|
||||
|
||||
Scenario: Update the overwritten file to return to their original values
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"prf_content": "Test QA"
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "prf_uid" stored in session array
|
||||
And I request "project/1265557095225ff5c688f46031700471/file-manager"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And that "prf_filename" is set to "TestQA.html"
|
||||
And that "prf_content" is set to "Test QA"
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Download files
|
||||
Given I request "project/1265557095225ff5c688f46031700471/file-manager/prf_uid/download" with the key "prf_uid" stored in session array as variable "prf_uid_<prf_number>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
| test_description | prf_number |
|
||||
| Download file | 0 |
|
||||
| Download file | 1 |
|
||||
| Download file | 2 |
|
||||
| Download file | 4 |
|
||||
Examples:
|
||||
| test_description | prf_number |
|
||||
| Download file | 0 |
|
||||
| Download file | 1 |
|
||||
| Download file | 2 |
|
||||
| Download file | 4 |
|
||||
|
||||
|
||||
Scenario Outline: Delete file
|
||||
@@ -166,25 +187,24 @@ Feature: Files Manager Resources Main Tests
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
| test_description | prf_number |
|
||||
| delete public folder | 0 |
|
||||
| delete mailtemplates folder | 1 |
|
||||
| delete public subfolder | 2 |
|
||||
| delete mailtemplates subfolder | 3 |
|
||||
| delete mailtemplates subfolder | 4 |
|
||||
| delete mailtemplates subfolder | 5 |
|
||||
| delete mailtemplates subfolder | 6 |
|
||||
Examples:
|
||||
| test_description | prf_number |
|
||||
| delete public folder | 0 |
|
||||
| delete mailtemplates folder | 1 |
|
||||
| delete public subfolder | 2 |
|
||||
| delete mailtemplates subfolder | 3 |
|
||||
| delete mailtemplates subfolder | 4 |
|
||||
| delete mailtemplates subfolder | 5 |
|
||||
| delete mailtemplates subfolder | 6 |
|
||||
|
||||
|
||||
Scenario Outline: Delete folder
|
||||
Given that I want to delete the folder
|
||||
And I request "project/1265557095225ff5c688f46031700471/file-manager/folder?path=<prf_path>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
| test_description | prf_path |
|
||||
| delete public sub folder | templates/templates_subfolder |
|
||||
| delete templates sub folder | public/public_subfolder |
|
||||
Examples:
|
||||
| test_description | prf_path |
|
||||
| delete public sub folder | templates/templates_subfolder |
|
||||
| delete templates sub folder | public/public_subfolder |
|
||||
|
||||
@@ -37,12 +37,3 @@ Feature: File Manager Negative Tests
|
||||
| Field Required prf_filename in public | 1265557095225ff5c688f46031700471 | | public/ | only text | 400 | prf_filename |
|
||||
| Field Required prf_filename in template | 1265557095225ff5c688f46031700471 | | templates/ | <h1>Test</h1><p>html test</p> | 400 | prf_filename |
|
||||
| Field Required project | | file_test_1.txt | public/ | only text | 400 | prj_uid |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# how to get content if a file - revisar si hay el endpoint para poner el contenido del html
|
||||
# how to delete sub folders
|
||||
# upload big files -
|
||||
# actualizar el conteniudo subiendo un archivo nuevo con el mismo nombre...
|
||||
@@ -35,7 +35,7 @@ Feature: User
|
||||
#GET /api/1.0/{workspace}/user/{usr_uid}
|
||||
# Upload a image
|
||||
Scenario: Upload a image
|
||||
Given POST I want to upload the image "/home/daniel/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
|
||||
Given POST I want to upload the image "/home/wendy/photo/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
|
||||
|
||||
#POST /api/1.0/{workspace}/user
|
||||
# Create new User
|
||||
|
||||
@@ -95,14 +95,6 @@ Feature: User Main Tests
|
||||
| Create user Vacation | 5 | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample |
|
||||
|
||||
|
||||
#Para que funcione este test, debe existir el archivo que se quiere subir
|
||||
#GET /api/1.0/{workspace}/user/{usr_uid}
|
||||
# Upload a image
|
||||
Scenario: Upload a image
|
||||
Given POST I want to upload the image "/home/daniel/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
|
||||
|
||||
|
||||
# Upload a image
|
||||
Scenario Outline: Upload a image
|
||||
Given POST I want to upload the image "<usr_photo>" to user with the key "usr_uid" stored in session array as variable "usr_uid_<usr_number>". Url "user/"
|
||||
|
||||
@@ -149,7 +141,7 @@ Feature: User Main Tests
|
||||
"usr_phone": "<usr_phone>",
|
||||
"usr_position": "<usr_position>",
|
||||
"usr_replaced_by": "<usr_replaced_by>",
|
||||
"usr_due_date": "<usr_dgit addue_date>",
|
||||
"usr_due_date": "<usr_due_date>",
|
||||
"usr_calendar": "<usr_calendar>",
|
||||
"usr_status": "<usr_status>",
|
||||
"usr_role": "<usr_role>",
|
||||
@@ -167,8 +159,8 @@ Feature: User Main Tests
|
||||
Examples:
|
||||
|
||||
| Test_description | usr_number | usr_firstname | usr_lastname | usr_username | usr_email | usr_address | usr_zip_code | usr_country | usr_city | usr_location | usr_phone | usr_position | usr_replaced_by | usr_due_date | usr_calendar | usr_status | usr_role | usr_new_pass | usr_cnf_pass |
|
||||
| Update usr_calendar, usr_role | 1 | jhoohan | smith | jhoohan | jhon@gmail.com | grenn #344 | 555-6555 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | sample | sample |
|
||||
| Update usr_firstname, usr_lastname, usr_username | 2 | william | carters | william | will@gmail.com | saim #45 | 555-6522 | BO | L | LPB | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample |
|
||||
| Update usr_calendar, usr_role | 1 | jhoohan | smith | jhoohan | jhon@gmail.com | grenn #344 | 555-6555 | US | FL | MIA | 555-6655-555 | Gerencia | | 2014-02-15 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | sample | sample |
|
||||
| Update usr_firstname, usr_lastname, usr_username | 2 | wilian | carters | wilian | will@gmail.com | saim #45 | 555-6522 | BO | L | LPB | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample |
|
||||
| Update usr_status | 3 | sarita | sandler | sarita | saraah@gmail.com | laberh #985 | 555-9999 | AR | B | BUE | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin |
|
||||
|
||||
|
||||
@@ -202,7 +194,7 @@ Feature: User Main Tests
|
||||
|
||||
| Test_description | usr_number | usr_firstname | usr_lastname | usr_username | usr_email | usr_address | usr_zip_code | usr_country | usr_city | usr_location | usr_phone | usr_position | usr_replaced_by | usr_due_date | usr_calendar | usr_status | usr_role | usr_new_pass | usr_cnf_pass |
|
||||
| Update usr_calendar, usr_role | 1 | jhoohan | smith | jhoohan | jhon@gmail.com | grenn #344 | 555-6555 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | sample | sample |
|
||||
| Update usr_firstname, usr_lastname, usr_username | 2 | william | carters | william | will@gmail.com | saim #45 | 555-6522 | BO | L | LPB | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample |
|
||||
| Update usr_firstname, usr_lastname, usr_username | 2 | wilian | carters | wilian | will@gmail.com | saim #45 | 555-6522 | BO | L | LPB | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample |
|
||||
| Update usr_status | 3 | sarita | sandler | sarita | saraah@gmail.com | laberh #985 | 555-9999 | AR | B | BUE | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin |
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Process Variables Main Tests
|
||||
Requirements:
|
||||
a workspace with the process 3306142435318cd22d1eba2015305561 ("Process variables") already loaded
|
||||
there are three activities in the process
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Get all variables of a Process
|
||||
And I request "project/3306142435318cd22d1eba2015305561/variables"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the "var_name" property in row <i> equals "<var_name>"
|
||||
|
||||
Examples:
|
||||
| i | var_name |
|
||||
| 0 | SYS_LANG |
|
||||
| 1 | SYS_SKIN |
|
||||
| 2 | SYS_SYS |
|
||||
| 3 | APPLICATION |
|
||||
| 4 | PROCESS |
|
||||
| 5 | TASK |
|
||||
| 6 | INDEX |
|
||||
| 7 | USER_LOGGED |
|
||||
| 8 | USR_USERNAME |
|
||||
| 9 | PIN |
|
||||
| 10 | grilla2 |
|
||||
| 11 | grilla3 |
|
||||
| 12 | grilla1 |
|
||||
|
||||
|
||||
Scenario: Get grid variables of a Process
|
||||
Given I request "project/3306142435318cd22d1eba2015305561/grid/variables"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the response has 3 records
|
||||
And the "var_name" property in row 0 equals "grilla2"
|
||||
And the "var_name" property in row 1 equals "grilla3"
|
||||
And the "var_name" property in row 2 equals "grilla1"
|
||||
|
||||
|
||||
Scenario: Get all variables of a Grid
|
||||
Given I request "project/3306142435318cd22d1eba2015305561/grid/8246998615318cd7cc451d2089449499/variables"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And that "var_name" is set to "fecha"
|
||||
And that "var_label" is set to "Date Static Date Y/m/d 24/07-31/07"
|
||||
And that "var_type" is set to "date"
|
||||
And that "var_name" is set to "text"
|
||||
And that "var_label" is set to "Text Field + Validate Any"
|
||||
And that "var_type" is set to "text"
|
||||
And that "var_name" is set to "currency"
|
||||
And that "var_label" is set to "Currency Fields Real Number ###,###,###,###.##"
|
||||
And that "var_type" is set to "currency"
|
||||
And that "var_name" is set to "porcentage"
|
||||
And that "var_label" is set to "Porcentage Field + Real Number ###.## %"
|
||||
And that "var_type" is set to "percentage"
|
||||
And that "var_name" is set to "textarea"
|
||||
And that "var_label" is set to "Text area Field"
|
||||
And that "var_type" is set to "textarea"
|
||||
And that "var_name" is set to "dropdown"
|
||||
And that "var_label" is set to "Dropdown Field"
|
||||
And that "var_type" is set to "dropdown"
|
||||
And that "var_name" is set to "yesno"
|
||||
And that "var_label" is set to "Yes/No Field"
|
||||
And that "var_type" is set to "yesno"
|
||||
And that "var_name" is set to "checkbox"
|
||||
And that "var_label" is set to "Check Box Field"
|
||||
And that "var_type" is set to "checkbox"
|
||||
And that "var_name" is set to "suggest1"
|
||||
And that "var_label" is set to "Suggest Usuarios"
|
||||
And that "var_type" is set to "suggest"
|
||||
And that "var_name" is set to "link"
|
||||
And that "var_label" is set to "Link Field"
|
||||
And that "var_type" is set to "link"
|
||||
And that "var_name" is set to "addfile"
|
||||
And that "var_label" is set to "Add File Field"
|
||||
And that "var_type" is set to "file"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Process Variables Negative Tests
|
||||
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Get all variables of a Grid bad parameters (negative tests)
|
||||
Given I request "project/14414793652a5d718b65590036026581/grid/00000000000000000000000000000000/variables"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be <status_code>
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And the response status message should have the following text "<status_message>"
|
||||
|
||||
Examples:
|
||||
| status_code | status_message |
|
||||
| 400 | grid_uid |
|
||||
@@ -100,7 +100,7 @@ Feature: Project Properties - Step Resources
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the "obj_uid" property in row 1 equals "32743823452cd63105006e1076595203"
|
||||
And the "obj_uid" property in row 1 equals "6869969705306aaae049a62048840877"
|
||||
And the "obj_title" property in row 1 equals "OutputDocument Demo"
|
||||
And the "obj_description" property in row 1 equals "Description"
|
||||
And the "obj_type" property in row 1 equals "OUTPUT_DOCUMENT"
|
||||
|
||||
@@ -39,7 +39,7 @@ Feature: Project Properties - Step Resources Main Tests
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"git
|
||||
And the type is "object"
|
||||
And store "step_uid" in session array as variable "step_uid_<step_number>"
|
||||
|
||||
Examples:
|
||||
@@ -328,7 +328,7 @@ Feature: Project Properties - Step Resources Main Tests
|
||||
| Trigger assigned to External in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 5 | 0 |
|
||||
|
||||
|
||||
Scenario Outline: Unassign all"DynaForm Demo1" from "Task1"
|
||||
Scenario Outline: Unassign all "DynaForm Demo1" from "Task1" and "Task 2"
|
||||
Given that I have a valid access_token
|
||||
And that I want to delete a resource with the key "step1" stored in session array
|
||||
Given that I want to delete a resource with the key "step_uid" stored in session array as variable "step_uid_<step_number>"
|
||||
@@ -344,6 +344,8 @@ Feature: Project Properties - Step Resources Main Tests
|
||||
| Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 |
|
||||
| Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 |
|
||||
| Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 |
|
||||
| Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 5 |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: List assigned Steps to "Task1" & "Task2" (empty) (verify if everithing was deleted)
|
||||
|
||||
@@ -8,7 +8,7 @@ Feature: Group
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario Outline: Get the Trigger Wizards List when there are exactly 6 library
|
||||
Scenario Outline: Get the Trigger Wizard List when there are exactly 6 library
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizards"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
@@ -20,10 +20,13 @@ Feature: Group
|
||||
And the "lib_class_name" property in row <i> equals "<lib_class_name>"
|
||||
|
||||
Examples:
|
||||
| i | lib_name | lib_title | lib_class_name |
|
||||
| 0 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php |
|
||||
| 1 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
|
||||
| 2 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
|
||||
| i | lib_name | lib_title | lib_class_name |
|
||||
| 0 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php |
|
||||
| 1 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php |
|
||||
| 2 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
|
||||
| 3 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
|
||||
| 4 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php |
|
||||
| 5 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php |
|
||||
|
||||
|
||||
Scenario Outline: Get a single Library
|
||||
@@ -65,6 +68,7 @@ Feature: Group
|
||||
| pmSugar | CreateSugarAccount | Creates SugarCRM entries from the Account module |
|
||||
|
||||
|
||||
|
||||
Scenario: Get a List of triggers of a project
|
||||
And I request "project/14414793652a5d718b65590036026581/triggers"
|
||||
And the content type is "application/json"
|
||||
@@ -74,7 +78,7 @@ Feature: Group
|
||||
And the json data is an empty array
|
||||
|
||||
|
||||
Scenario Outline: Create new Trigger
|
||||
Scenario Outline: Create new Trigger: PMFAddAttachmentToArray
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
@@ -104,9 +108,43 @@ Feature: Group
|
||||
Examples:
|
||||
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.arrayData | tri_params.input.index | tri_params.input.value | tri_params.input.suffix | tri_params.output.tri_answer |
|
||||
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger | | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta |
|
||||
| 1 | pmFunctions | PMFSendMessage | My trigger 1 | Envio de email | SCRIPT |
|
||||
|
||||
|
||||
Scenario Outline: Create new Trigger: createDWS
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"tri_title": "<tri_title>",
|
||||
"tri_description": "<tri_description>",
|
||||
"tri_type": "<tri_type>",
|
||||
"tri_params": {
|
||||
"input": {
|
||||
|
||||
"sharepointServer": "<tri_params.input.sharepointServer>",
|
||||
"auth": "<tri_params.input.auth>",
|
||||
"name": "<tri_params.input.name>",
|
||||
"users": "<tri_params.input.users>",
|
||||
"title": "<tri_params.input.title>",
|
||||
"documents": "<tri_params.input.documents>"
|
||||
|
||||
},
|
||||
"output": {
|
||||
"tri_answer": "<tri_params.output.tri_answer>"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And store "tri_uid" in session array as variable "tri_uid<i>"
|
||||
|
||||
Examples:
|
||||
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.sharepointServer | tri_params.input.auth | tri_params.input.name | tri_params.input.users | tri_params.input.title | tri_params.input.documents | tri_params.output.tri_answer |
|
||||
| 1 | pmTrSharepoint | createDWS | Sharepoint 1 | | SCRIPT | @@SERVER | username:password | Test DWS | @@users | Test DWS | /files/test.doc | $respuesta |
|
||||
|
||||
Scenario Outline: Update Trigger
|
||||
Given PUT this data:
|
||||
"""
|
||||
@@ -139,6 +177,42 @@ Feature: Group
|
||||
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT | array(1, 2, 3, 4) | 1 | 2 | My Copy2({i}) | $r |
|
||||
|
||||
|
||||
Scenario Outline: Create new Trigger: createDWS
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"tri_title": "<tri_title>",
|
||||
"tri_description": "<tri_description>",
|
||||
"tri_type": "<tri_type>",
|
||||
"tri_params": {
|
||||
"input": {
|
||||
|
||||
"sharepointServer": "<tri_params.input.sharepointServer>",
|
||||
"auth": "<tri_params.input.auth>",
|
||||
"name": "<tri_params.input.name>",
|
||||
"users": "<tri_params.input.users>",
|
||||
"title": "<tri_params.input.title>",
|
||||
"documents": "<tri_params.input.documents>"
|
||||
|
||||
},
|
||||
"output": {
|
||||
"tri_answer": "<tri_params.output.tri_answer>"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.sharepointServer | tri_params.input.auth | tri_params.input.name | tri_params.input.users | tri_params.input.title | tri_params.input.documents | tri_params.output.tri_answer |
|
||||
| 1 | pmTrSharepoint | createDWS | Sharepoint 1 - Modified | | SCRIPT | @@SERVER_URL | username:password | Test DWS | @@users | Test DWS | /files/test.doc | $respuesta |
|
||||
|
||||
|
||||
Scenario Outline: Get a Trigger that was created with the wizard
|
||||
Given that I want to get a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
|
||||
@@ -151,8 +225,10 @@ Feature: Group
|
||||
And that "tri_type" is set to "<tri_type>"
|
||||
|
||||
Examples:
|
||||
| i | lib_name | fn_name | tri_title | tri_description | tri_type |
|
||||
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT |
|
||||
|
||||
| i | lib_name | fn_name | tri_title | tri_description | tri_type |
|
||||
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT |
|
||||
| 1 | pmTrSharepoint | createDWS | Test DWS | | SCRIPT |
|
||||
|
||||
|
||||
Scenario Outline: Delete a trigger of a project
|
||||
@@ -166,6 +242,7 @@ Feature: Group
|
||||
Examples:
|
||||
| i |
|
||||
| 0 |
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario: Get a List of triggers of a project
|
||||
|
||||
@@ -6,3 +6,48 @@ Feature: Triggers Wizard Negative Tests
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Get a single Library with bad parameters (negative tests)
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/sampleqa"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "not exist"
|
||||
|
||||
|
||||
Scenario: Get a single Function of the Library with bad parameters (negative tests)
|
||||
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/qadesarrollo/funcionexterna"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "not exist"
|
||||
|
||||
|
||||
Scenario Outline: Create new Trigger with bad parameters (negative tests)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"tri_title": "<tri_title>",
|
||||
"tri_description": "<tri_description>",
|
||||
"tri_type": "<tri_type>",
|
||||
"tri_params": {
|
||||
"input": {
|
||||
"arrayData": "<tri_params.input.arrayData>",
|
||||
"index": "<tri_params.input.index>",
|
||||
"value": "<tri_params.input.value>",
|
||||
"suffix": "<tri_params.input.suffix>"
|
||||
},
|
||||
"output": {
|
||||
"tri_answer": "<tri_params.output.tri_answer>"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And I request "project/<project>/trigger-wizard/<lib_name>/<fn_name>"
|
||||
Then the response status code should be <error_code>
|
||||
And the response status message should have the following text "<error_message>"
|
||||
|
||||
Examples:
|
||||
| test_description | project | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.arrayData | tri_params.input.index | tri_params.input.value | tri_params.input.suffix | tri_params.output.tri_answer | error_code | error_message |
|
||||
| Field required project | | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | prj_uid |
|
||||
| Field required tri_title | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_title |
|
||||
| Field required tri_type | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_type |
|
||||
| Field required tri_params input | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | | | | | $respuesta | 400 | arrayData |
|
||||
| Field required tri_params output | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | | 400 | tri_answer |
|
||||
| Invalid lib_name | 14414793652a5d718b65590036026581 | processmakerfunction | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | lib_name |
|
||||
| Invalid tri_type | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | sample | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_type |
|
||||
@@ -931,6 +931,11 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function theResponseStatusCodeShouldBe($httpStatus)
|
||||
{
|
||||
if(!(isset($this->_response))){
|
||||
throw new \Exception('HTTP code does not match ' . $httpStatus .
|
||||
' (actual: No response defined)'
|
||||
);
|
||||
}
|
||||
if ((string)$this->_response->getStatusCode() !== $httpStatus) {
|
||||
$message="";
|
||||
if($bodyResponse=json_decode($this->_response->getBody(true))){
|
||||
@@ -1254,7 +1259,7 @@ class RestContext extends BehatContext
|
||||
$pageUrl = str_replace($varName, $varValue, $pageUrl);
|
||||
|
||||
|
||||
$this->printDebug("URL: $pageUrl\n$varName = $varValue\n");
|
||||
//$this->printDebug("URL: $pageUrl\n$varName = $varValue\n");
|
||||
|
||||
|
||||
$this->iRequest($pageUrl, $urlType);
|
||||
|
||||
@@ -412,7 +412,7 @@ class Department extends BaseDepartment
|
||||
$criteria->add( DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL );
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$objects = DepartmentPeer::doSelect( $criteria, $con );
|
||||
global $RBAC;
|
||||
$oUsers = new Users();
|
||||
|
||||
foreach ($objects as $oDepartment) {
|
||||
$node = array ();
|
||||
@@ -426,7 +426,7 @@ class Department extends BaseDepartment
|
||||
|
||||
$manager = $oDepartment->getDepManager();
|
||||
if ($manager != '') {
|
||||
$UserUID = $RBAC->load( $manager );
|
||||
$UserUID = $oUsers->load($manager);
|
||||
$node['DEP_MANAGER_USERNAME'] = isset( $UserUID['USR_USERNAME'] ) ? $UserUID['USR_USERNAME'] : '';
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = isset( $UserUID['USR_FIRSTNAME'] ) ? $UserUID['USR_FIRSTNAME'] : '';
|
||||
$node['DEP_MANAGER_LASTNAME'] = isset( $UserUID['USR_LASTNAME'] ) ? $UserUID['USR_LASTNAME'] : '';
|
||||
|
||||
@@ -68,11 +68,11 @@ if ($action == "uploadFileNewProcess") {
|
||||
|
||||
$isCorrectTypeFile = 1;
|
||||
|
||||
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
|
||||
if (isset( $_FILES['PROCESS_FILENAME']['type'] )) {
|
||||
$allowedExtensions = array ($processFileType
|
||||
);
|
||||
$allowedExtensions = array ('pm');
|
||||
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
|
||||
if (! in_array( end( explode( ".", $_FILES['PROCESS_FILENAME']['name'] ) ), $allowedExtensions )) {
|
||||
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
|
||||
}
|
||||
}
|
||||
@@ -99,10 +99,10 @@ if ($action == "uploadFileNewProcess") {
|
||||
$filename = $_REQUEST["PRO_FILENAME"];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
} else {
|
||||
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
|
||||
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
|
||||
if ($_FILES['PROCESS_FILENAME']['error'] == 0) {
|
||||
$filename = $_FILES['PROCESS_FILENAME']['name'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
|
||||
$tempName = $_FILES['PROCESS_FILENAME']['tmp_name'];
|
||||
//$action = "none";
|
||||
G::uploadFile( $tempName, $path, $filename );
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php http_response_code(404); die; ?>
|
||||
<?php if (function_exists("http_response_code")) {
|
||||
http_response_code(404);
|
||||
}?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<META http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
@@ -48,8 +48,8 @@ class Department
|
||||
$criteria->add( DepartmentPeer::DEP_UID, $dep_uid, \Criteria::EQUAL );
|
||||
$con = \Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$objects = DepartmentPeer::doSelect( $criteria, $con );
|
||||
$oUsers = new \Users();
|
||||
|
||||
global $RBAC;
|
||||
$node = array ();
|
||||
foreach ($objects as $oDepartment) {
|
||||
$node['DEP_UID'] = $oDepartment->getDepUid();
|
||||
@@ -62,7 +62,7 @@ class Department
|
||||
|
||||
$manager = $oDepartment->getDepManager();
|
||||
if ($manager != '') {
|
||||
$UserUID = $RBAC->load( $manager );
|
||||
$UserUID = $oUsers->load($manager);
|
||||
$node['DEP_MANAGER_USERNAME'] = isset( $UserUID['USR_USERNAME'] ) ? $UserUID['USR_USERNAME'] : '';
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = isset( $UserUID['USR_FIRSTNAME'] ) ? $UserUID['USR_FIRSTNAME'] : '';
|
||||
$node['DEP_MANAGER_LASTNAME'] = isset( $UserUID['USR_LASTNAME'] ) ? $UserUID['USR_LASTNAME'] : '';
|
||||
@@ -110,7 +110,7 @@ class Department
|
||||
if (isset($dep_data['DEP_PARENT']) && $dep_data['DEP_PARENT'] != '') {
|
||||
Validator::depUid($dep_data['DEP_PARENT'], 'dep_parent');
|
||||
}
|
||||
if (isset($dep_data['DEP_MANAGER']) && $dep_data['DEP_PARENT'] != '') {
|
||||
if (isset($dep_data['DEP_MANAGER']) && $dep_data['DEP_MANAGER'] != '') {
|
||||
Validator::usrUid($dep_data['DEP_MANAGER'], 'dep_manager');
|
||||
}
|
||||
if (isset($dep_data['DEP_STATUS'])) {
|
||||
|
||||
99
workflow/engine/src/ProcessMaker/Importer/Importer.php
Normal file
99
workflow/engine/src/ProcessMaker/Importer/Importer.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Importer;
|
||||
|
||||
abstract class Importer
|
||||
{
|
||||
protected $filename = "";
|
||||
protected $saveDir = "";
|
||||
|
||||
const IMPORT_OPTION_OVERWRITE = "OVERWRITE_PROJECT";
|
||||
const IMPORT_OPTION_DISABLE_AND_CREATE_NEW = "DISABLE_AND_CREATE_NEW_PROJECT";
|
||||
const IMPORT_OPTION_CREATE_NEW = "CREATE_NEW_PROJECT";
|
||||
|
||||
/**
|
||||
* Success, Project imported successfully.
|
||||
*/
|
||||
const IMPORT_STAT_SUCCESS = 100;
|
||||
/**
|
||||
* Error, Target Project already exists.
|
||||
*/
|
||||
const IMPORT_STAT_TARGET_ALREADY_EXISTS = 101;
|
||||
/**
|
||||
* Error, Invalid file type or the file have corrupt data.
|
||||
*/
|
||||
const IMPORT_STAT_INVALID_SOURCE_FILE = 102;
|
||||
|
||||
|
||||
public abstract function import();
|
||||
public abstract function validateSource();
|
||||
public abstract function targetExists();
|
||||
|
||||
|
||||
public function setSaveDir($dirName)
|
||||
{
|
||||
$this->saveDir = rtrim($dirName, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
public function getSaveDir()
|
||||
{
|
||||
if (empty($this->saveDir)) {
|
||||
$this->saveDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
return $this->saveDir;
|
||||
}
|
||||
|
||||
public function setSourceFile($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
}
|
||||
|
||||
public function setSourceFromGlobals($varName)
|
||||
{
|
||||
/*[PROCESS_FILENAME] => Array
|
||||
(
|
||||
[name] => sample29.pm
|
||||
[type] => application/pm
|
||||
[tmp_name] => /tmp/phpvHpCVO
|
||||
[error] => 0
|
||||
[size] => 1260881
|
||||
)*/
|
||||
|
||||
if (! array_key_exists($varName, $_FILES)) {
|
||||
throw new \Exception("Couldn't find specified source \"$varName\" in PHP Globals");
|
||||
}
|
||||
|
||||
$data = $_FILES[$varName];
|
||||
|
||||
if ($data["error"] != 0){
|
||||
throw new \Exception("Error while uploading file. Error code: {$data["error"]}");
|
||||
}
|
||||
|
||||
$this->filename = $this->getSaveDir() . $data["name"];
|
||||
|
||||
$oldUmask = umask(0);
|
||||
move_uploaded_file($data["tmp_name"], $this->filename);
|
||||
@chmod($this->filename, 0755);
|
||||
umask($oldUmask);
|
||||
}
|
||||
|
||||
public function prepare()
|
||||
{
|
||||
if ($this->validateSource() === false) {
|
||||
throw new \Exception(
|
||||
"Error, Invalid file type or the file have corrupt data",
|
||||
self::IMPORT_STAT_INVALID_SOURCE_FILE
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->targetExists()) {
|
||||
throw new \Exception(sprintf(
|
||||
"Project already exists, you need set an action to continue. " .
|
||||
"Avaliable actions: [%s|%s|%s].", self::IMPORT_OPTION_CREATE_NEW,
|
||||
self::IMPORT_OPTION_OVERWRITE, self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW
|
||||
), self::IMPORT_STAT_TARGET_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
return self::IMPORT_STAT_SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Importer;
|
||||
|
||||
class WorkflowImporter extends Importer
|
||||
{
|
||||
public function validateSource()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function targetExists()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function import($option = self::IMPORT_OPTION_CREATE_NEW)
|
||||
{
|
||||
switch ($option) {
|
||||
case self::IMPORT_OPTION_CREATE_NEW:
|
||||
$this->prepare();
|
||||
$this->createNewProject();
|
||||
break;
|
||||
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
|
||||
break;
|
||||
case self::IMPORT_OPTION_OVERWRITE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function createNewProject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function updateProject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function disableCurrentProject()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
17
workflow/engine/src/ProcessMaker/Importer/XmlImporter.php
Normal file
17
workflow/engine/src/ProcessMaker/Importer/XmlImporter.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Importer;
|
||||
|
||||
class XmlImporter
|
||||
{
|
||||
public $filename = "";
|
||||
|
||||
public function setSourceFile($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,10 +16,94 @@ if (!class_exists("Propel")) {
|
||||
*/
|
||||
class DepartmentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSaveDepartment()
|
||||
{
|
||||
$oDepartment = new \BusinessModel\Department();
|
||||
|
||||
////////// Create department parent
|
||||
$dep1 = array (
|
||||
'dep_title' => 'departamento padre'
|
||||
);
|
||||
$arrayDepartments = $oDepartment->saveDepartment($dep1);
|
||||
$this->assertTrue(isset($arrayDepartments['dep_uid']));
|
||||
$this->assertEquals($arrayDepartments['dep_parent'], '');
|
||||
$this->assertEquals($arrayDepartments['dep_title'], 'departamento padre');
|
||||
$this->assertEquals($arrayDepartments['dep_status'], 'ACTIVE');
|
||||
$this->assertEquals($arrayDepartments['dep_manager'], '');
|
||||
$this->assertEquals($arrayDepartments['has_children'], 0);
|
||||
|
||||
////////// Create department child
|
||||
$dep1Uid = $arrayDepartments['dep_uid'];
|
||||
$dep2 = array (
|
||||
'dep_parent' => $dep1Uid,
|
||||
'dep_manager' => '00000000000000000000000000000001',
|
||||
'dep_title' => 'departamento hijo1',
|
||||
'dep_status' => 'INACTIVE'
|
||||
);
|
||||
$arrayDepartments2 = $oDepartment->saveDepartment($dep2);
|
||||
$this->assertTrue(isset($arrayDepartments2['dep_uid']));
|
||||
$this->assertEquals($arrayDepartments2['dep_parent'], $dep1Uid);
|
||||
$this->assertEquals($arrayDepartments2['dep_title'], 'departamento hijo1');
|
||||
$this->assertEquals($arrayDepartments2['dep_status'], 'INACTIVE');
|
||||
$this->assertEquals($arrayDepartments2['dep_manager'], '00000000000000000000000000000001');
|
||||
$this->assertEquals($arrayDepartments2['has_children'], 0);
|
||||
|
||||
////////// Update department parent
|
||||
$depUp1 = array (
|
||||
'dep_uid' => $dep1Uid,
|
||||
'dep_title' => 'DepPadre',
|
||||
'dep_manager' => '00000000000000000000000000000001'
|
||||
);
|
||||
$oDepartment->saveDepartment($depUp1, false);
|
||||
|
||||
$dep2Uid = $arrayDepartments2['dep_uid'];
|
||||
$depUp2 = array (
|
||||
'dep_uid' => $dep2Uid,
|
||||
'dep_title' => 'DepHijo',
|
||||
'dep_manager' => '',
|
||||
);
|
||||
$oDepartment->saveDepartment($depUp2, false);
|
||||
}
|
||||
|
||||
public function testGetDepartments()
|
||||
{
|
||||
$oDepartment = new \BusinessModel\Department();
|
||||
$arrayDepartments = $oDepartment->getDepartments();
|
||||
$this->assertTrue(is_array($arrayDepartments));
|
||||
$this->assertEquals(count($arrayDepartments), 1);
|
||||
$this->assertTrue(is_array($arrayDepartments[0]['dep_children']));
|
||||
$this->assertEquals(count($arrayDepartments[0]['dep_children']), 1);
|
||||
}
|
||||
|
||||
public function testGetDepartment()
|
||||
{
|
||||
$oDepartment = new \BusinessModel\Department();
|
||||
$arrayDepartments = $oDepartment->getDepartments();
|
||||
$depIdPadre = $arrayDepartments[0]['dep_uid'];
|
||||
$depIdChild = $arrayDepartments[0]['dep_children'][0]['dep_uid'];
|
||||
$oDepartment = new \BusinessModel\Department();
|
||||
$dataPadre = $oDepartment->getDepartment($depIdPadre);
|
||||
$dataChild = $oDepartment->getDepartment($depIdChild);
|
||||
|
||||
$this->assertTrue(is_array($dataPadre));
|
||||
$this->assertEquals($dataPadre['dep_title'], 'DepPadre');
|
||||
$this->assertEquals($dataPadre['dep_manager'], '00000000000000000000000000000001');
|
||||
$this->assertTrue(is_array($dataChild));
|
||||
$this->assertEquals($dataChild['dep_title'], 'DepHijo');
|
||||
$this->assertEquals($dataChild['dep_manager'], '');
|
||||
}
|
||||
|
||||
public function testDeleteDepartment()
|
||||
{
|
||||
$oDepartment = new \BusinessModel\Department();
|
||||
$arrayDepartments = $oDepartment->getDepartments();
|
||||
$dataDepChild = $arrayDepartments[0]['dep_children'];
|
||||
|
||||
$oDepartment->deleteDepartment($dataDepChild[0]['dep_uid']);
|
||||
$oDepartment->deleteDepartment($arrayDepartments[0]['dep_uid']);
|
||||
|
||||
$arrayDepartments = $oDepartment->getDepartments();
|
||||
$this->assertEquals(count($arrayDepartments), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,52 +104,48 @@
|
||||
<div class="head"></div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="#" class="mafe-button-save">Save</a></li>
|
||||
<li><a href="#" class="mafe-button-export-process">Export process</a></li>
|
||||
<li><a href="#" class="mafe-button-undo">Undo</a>
|
||||
<a href="#" class="mafe-button-redo">Redo</a></li>
|
||||
<li><input type="button" value="Zoom" class="mafe-button-zoom"> </li>
|
||||
<li><a href="#" class="mafe-button-save"></a></li>
|
||||
<li><a href="#" class="mafe-button-export-process"></a></li>
|
||||
<li><a href="#" class="mafe-button-undo"></a> <a href="#" class="mafe-button-redo"></a></li>
|
||||
<li><input type="button" value="" class="mafe-button-zoom"> </li>
|
||||
<li><a href="#" title="Full screen"class="mafe-button-fullscreen"></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="bpmn_shapes">
|
||||
<div class="head">
|
||||
<span class="mafe-shapes-collapse-icon"></span></div>
|
||||
<div class="head"><span class="mafe-shapes-collapse-icon"></span></div>
|
||||
</div>
|
||||
<div class="content_controls">
|
||||
<div class="head"><span class="mafe-controls-collapse-icon"></span></div>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="mafe-menu-dynaform">Dynaforms</a>
|
||||
<a href="#" class="btn_create mafe-menu-dynaform-create"><span>Create</span></a>
|
||||
<a href="" class="mafe-menu-dynaform"></a>
|
||||
<a href="#" class="btn_create mafe-menu-dynaform-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-inputdocuments">Input documents</a>
|
||||
<a href="#" class="btn_create mafe-menu-inputdocuments-create"><span>Create</span></a>
|
||||
<a href="#" class="mafe-menu-inputdocuments"></a>
|
||||
<a href="#" class="btn_create mafe-menu-inputdocuments-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-outputdocuments">Output documents</a>
|
||||
<a href="#" class="btn_create mafe-menu-outputdocuments-create"><span>Create</span></a>
|
||||
<a href="#" class="mafe-menu-outputdocuments"></a>
|
||||
<a href="#" class="btn_create mafe-menu-outputdocuments-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-triggers">Triggers</a>
|
||||
<a href="#" class="btn_create mafe-menu-triggers-create"><span>Create</span></a>
|
||||
<a href="#" class="mafe-menu-triggers"></a>
|
||||
<a href="#" class="btn_create mafe-menu-triggers-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-reporttables">Report tables</a>
|
||||
<a href="#" class="btn_create mafe-menu-reporttables-create"><span>Create</span></a>
|
||||
<a href="#" class="mafe-menu-reporttables"></a>
|
||||
<a href="#" class="btn_create mafe-menu-reporttables-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-databaseconnections">Database connections</a>
|
||||
<a href="#" class="btn_create mafe-menu-databaseconnections-create"><span>Create</span></a>
|
||||
<a href="#" class="mafe-menu-databaseconnections"></a>
|
||||
<a href="#" class="btn_create mafe-menu-databaseconnections-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="mefe-menu-casescheduler">Case scheduler</a>
|
||||
<a href="#" class="btn_create mefe-menu-casescheduler-create"><span>Create</span></a>
|
||||
<a href="#" class="mefe-menu-casescheduler"></a>
|
||||
<a href="#" class="btn_create mafe-menu-casescheduler-create"><span></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1062,7 +1062,7 @@ importProcess = function()
|
||||
id : 'form-file',
|
||||
emptyText : _('ID_SELECT_PROCESS_FILE'),
|
||||
fieldLabel : _('ID_LAN_FILE'),
|
||||
name : 'form[PROCESS_FILENAME]',
|
||||
name : 'PROCESS_FILENAME',
|
||||
buttonText : '',
|
||||
buttonCfg : {
|
||||
iconCls : 'upload-icon'
|
||||
|
||||
Reference in New Issue
Block a user