diff --git a/features/backend/activity/main_tests_activity.feature b/features/backend/activity/main_tests_activity.feature index 09e2e7256..4ab70d3a8 100644 --- a/features/backend/activity/main_tests_activity.feature +++ b/features/backend/activity/main_tests_activity.feature @@ -121,7 +121,6 @@ Feature: Activity Resources Main Tests And the property "tas_assign_type" of "properties" is set to "" And the property "tas_assign_variable" of "properties" is set to "" And the property "tas_group_variable" of "properties" is set to "" - And the property "tas_selfservice_timeout" of "properties" is set to And the property "tas_selfservice_time" of "properties" is set to "" And the property "tas_selfservice_time_unit" of "properties" is set to "" And the property "tas_transfer_fly" of "properties" is set to "" diff --git a/features/backend/files_manager/main_test_files_manager.feature b/features/backend/files_manager/main_test_files_manager.feature index 75c457463..90e4b1393 100644 --- a/features/backend/files_manager/main_test_files_manager.feature +++ b/features/backend/files_manager/main_test_files_manager.feature @@ -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 "" - 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 |

Test

html test

modified | 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 |

Test

html test

modified | 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 equals "" And the "prf_content" property in row equals "" - - 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 |

Test

html test

modified | 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 |

Test

html test

modified | 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 "" to path "". Url "project/1265557095225ff5c688f46031700471/file-manager" And store "prf_uid" in session array as variable "prf_uid_" - 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_" 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=" - - 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 | diff --git a/features/backend/files_manager/negative_tests_files_manager.feature b/features/backend/files_manager/negative_tests_files_manager.feature index 0bd692c19..9417ee6dd 100644 --- a/features/backend/files_manager/negative_tests_files_manager.feature +++ b/features/backend/files_manager/negative_tests_files_manager.feature @@ -36,13 +36,4 @@ Feature: File Manager Negative Tests | Invalid path template | 1265557095225ff5c688f46031700471 | file_test_2.html | temptes_manager/ |

Test

html test

| 400 | prf_path | | Field Required prf_filename in public | 1265557095225ff5c688f46031700471 | | public/ | only text | 400 | prf_filename | | Field Required prf_filename in template | 1265557095225ff5c688f46031700471 | | templates/ |

Test

html test

| 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... \ No newline at end of file + | Field Required project | | file_test_1.txt | public/ | only text | 400 | prj_uid | \ No newline at end of file diff --git a/features/backend/pm_user/basic_sequence_pm_user.feature b/features/backend/pm_user/basic_sequence_pm_user.feature index 401c38747..7337af3be 100644 --- a/features/backend/pm_user/basic_sequence_pm_user.feature +++ b/features/backend/pm_user/basic_sequence_pm_user.feature @@ -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 diff --git a/features/backend/pm_user/main_tests_pm_user.feature b/features/backend/pm_user/main_tests_pm_user.feature index eebf7ea45..e3b4e4d71 100644 --- a/features/backend/pm_user/main_tests_pm_user.feature +++ b/features/backend/pm_user/main_tests_pm_user.feature @@ -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 "" to user with the key "usr_uid" stored in session array as variable "usr_uid_". Url "user/" @@ -149,7 +141,7 @@ Feature: User Main Tests "usr_phone": "", "usr_position": "", "usr_replaced_by": "", - "usr_due_date": "", + "usr_due_date": "", "usr_calendar": "", "usr_status": "", "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 | diff --git a/features/backend/process_variables/main_tests_process_variables.feature b/features/backend/process_variables/main_tests_process_variables.feature index e69de29bb..a69794e96 100644 --- a/features/backend/process_variables/main_tests_process_variables.feature +++ b/features/backend/process_variables/main_tests_process_variables.feature @@ -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 equals "" + + 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" diff --git a/features/backend/process_variables/negative_tests_process_variables.feature b/features/backend/process_variables/negative_tests_process_variables.feature index e69de29bb..3e621a83f 100644 --- a/features/backend/process_variables/negative_tests_process_variables.feature +++ b/features/backend/process_variables/negative_tests_process_variables.feature @@ -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 + And the response charset is "UTF-8" + And the type is "object" + And the response status message should have the following text "" + + Examples: + | status_code | status_message | + | 400 | grid_uid | \ No newline at end of file diff --git a/features/backend/step/basic_sequence_step.feature b/features/backend/step/basic_sequence_step.feature index e10e6113e..47850235f 100644 --- a/features/backend/step/basic_sequence_step.feature +++ b/features/backend/step/basic_sequence_step.feature @@ -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" diff --git a/features/backend/step/main_tests_step.feature b/features/backend/step/main_tests_step.feature index 4f1e6c657..028bc80b6 100644 --- a/features/backend/step/main_tests_step.feature +++ b/features/backend/step/main_tests_step.feature @@ -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_" 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_" @@ -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) diff --git a/features/backend/trigger_wizard/main_tests_trigger_wizards.feature b/features/backend/trigger_wizard/main_tests_trigger_wizards.feature index e4a0787d1..793c52409 100644 --- a/features/backend/trigger_wizard/main_tests_trigger_wizards.feature +++ b/features/backend/trigger_wizard/main_tests_trigger_wizards.feature @@ -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,12 +20,15 @@ Feature: Group And the "lib_class_name" property in row equals "" 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 And I request "project/14414793652a5d718b65590036026581/trigger-wizard/" And the content type is "application/json" @@ -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,8 +108,42 @@ 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_description": "", + "tri_type": "", + "tri_params": { + "input": { + + "sharepointServer": "", + "auth": "", + "name": "", + "users": "", + "title": "", + "documents": "" + + }, + "output": { + "tri_answer": "" + } + } + } + """ + And I request "project/14414793652a5d718b65590036026581/trigger-wizard//" + 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" + + 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: @@ -138,6 +176,42 @@ Feature: Group | 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, 3, 4) | 1 | 2 | My Copy2({i}) | $r | + +Scenario Outline: Create new Trigger: createDWS + Given PUT this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_params": { + "input": { + + "sharepointServer": "", + "auth": "", + "name": "", + "users": "", + "title": "", + "documents": "" + + }, + "output": { + "tri_answer": "" + } + } + } + """ + And that I want to update a resource with the key "tri_uid" stored in session array as variable "tri_uid" + And I request "project/14414793652a5d718b65590036026581/trigger-wizard//" + 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" @@ -151,8 +225,10 @@ Feature: Group And that "tri_type" is set to "" 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 diff --git a/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature b/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature index 72ea1727c..cb6a05cb7 100644 --- a/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature +++ b/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature @@ -5,4 +5,49 @@ Feature: Triggers Wizard Negative Tests Background: 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_description": "", + "tri_type": "", + "tri_params": { + "input": { + "arrayData": "", + "index": "", + "value": "", + "suffix": "" + }, + "output": { + "tri_answer": "" + } + } + } + """ + And I request "project//trigger-wizard//" + Then the response status code should be + And the response status message should have the following text "" + + 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 | \ No newline at end of file diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 4e8ffbfec..328603c94 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -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); diff --git a/workflow/engine/classes/model/Department.php b/workflow/engine/classes/model/Department.php index 7dbf711d0..49ae0e04a 100755 --- a/workflow/engine/classes/model/Department.php +++ b/workflow/engine/classes/model/Department.php @@ -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'] : ''; diff --git a/workflow/engine/methods/processes/processes_Import_Ajax.php b/workflow/engine/methods/processes/processes_Import_Ajax.php index de605eb18..4dadcc043 100644 --- a/workflow/engine/methods/processes/processes_Import_Ajax.php +++ b/workflow/engine/methods/processes/processes_Import_Ajax.php @@ -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 ); diff --git a/workflow/engine/skinEngine/neoclassic/error404.php b/workflow/engine/skinEngine/neoclassic/error404.php index 53fe00a72..902042a09 100644 --- a/workflow/engine/skinEngine/neoclassic/error404.php +++ b/workflow/engine/skinEngine/neoclassic/error404.php @@ -1,4 +1,6 @@ - + diff --git a/workflow/engine/src/BusinessModel/Department.php b/workflow/engine/src/BusinessModel/Department.php index eebd6f2cf..9b4f946ee 100644 --- a/workflow/engine/src/BusinessModel/Department.php +++ b/workflow/engine/src/BusinessModel/Department.php @@ -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'])) { diff --git a/workflow/engine/src/ProcessMaker/Importer/Importer.php b/workflow/engine/src/ProcessMaker/Importer/Importer.php new file mode 100644 index 000000000..d8ff8102d --- /dev/null +++ b/workflow/engine/src/ProcessMaker/Importer/Importer.php @@ -0,0 +1,99 @@ +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; + } +} \ No newline at end of file diff --git a/workflow/engine/src/ProcessMaker/Importer/WorkflowImporter.php b/workflow/engine/src/ProcessMaker/Importer/WorkflowImporter.php new file mode 100644 index 000000000..8ab4a83c7 --- /dev/null +++ b/workflow/engine/src/ProcessMaker/Importer/WorkflowImporter.php @@ -0,0 +1,44 @@ +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() + { + + } +} \ No newline at end of file diff --git a/workflow/engine/src/ProcessMaker/Importer/XmlImporter.php b/workflow/engine/src/ProcessMaker/Importer/XmlImporter.php new file mode 100644 index 000000000..2061e01c3 --- /dev/null +++ b/workflow/engine/src/ProcessMaker/Importer/XmlImporter.php @@ -0,0 +1,17 @@ +filename = $filename; + } + + public function import() + { + + } +} \ No newline at end of file diff --git a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php index fdf9bca74..09b1ad1a1 100644 --- a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php +++ b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php @@ -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); } } diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 8a02906fa..e5ca195fc 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -104,52 +104,48 @@
- -
-
-
+
diff --git a/workflow/engine/templates/processes/main.js b/workflow/engine/templates/processes/main.js index b8b07512f..190195378 100755 --- a/workflow/engine/templates/processes/main.js +++ b/workflow/engine/templates/processes/main.js @@ -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'