From eda70d2819f2a01ac1e4cb0271bdedc48a56176a Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Thu, 27 Feb 2014 16:46:26 -0400 Subject: [PATCH 1/3] Avance de los features triggers wizard, file manager --- .../activity/negative_tests_activity.feature | 2 +- .../main_test_files_manager.feature | 55 ++++++++++--------- .../main_tests_supervisor.feature | 2 +- .../main_tests_trigger_wizards.feature | 0 .../negative_tests_triggers_wizards.feature | 0 5 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 features/backend/trigger_wizard/main_tests_trigger_wizards.feature create mode 100644 features/backend/trigger_wizard/negative_tests_triggers_wizards.feature diff --git a/features/backend/activity/negative_tests_activity.feature b/features/backend/activity/negative_tests_activity.feature index 71c71bb53..b222d7b6d 100644 --- a/features/backend/activity/negative_tests_activity.feature +++ b/features/backend/activity/negative_tests_activity.feature @@ -104,4 +104,4 @@ Scenario Outline: Update the Definition of a Activity and the check if the value | Invalid tas_type_day | 95655319552a5c790b69a04054667879 | Task2 | Case Description | @@SYS_NEXT_USER_TO_BE_ASSIGNED | template.html | TRUE | BALANCED | @@USER_LOGGED | @@GROUP_UID | 1 | 2 | DAYS | | FALSE | 2 | DAYS | 6 | | ADHOC | Case Title | Case Description | FALSE | Titulo de Notificacion 1| template | Esta es una Notificacion | template.html | tas_type_day | | Invalid tas_type | 63843886052a5cc066e4c04056414372 | Task3 | Case Description | @@SYS_NEXT_USER_TO_BE_ASSIGNED | template.html | TRUE | BALANCED | @@USER_LOGGED | @@GROUP_UID | 1 | 2 | DAYS | | FALSE | 2 | DAYS | 2 | | INPUT | Case Title | Case Description | FALSE | Titulo de Notificacion 1| template | Esta es una Notificacion | template.html | tas_type | | Invalid tas_send_last_email | 97192372152a5c78f04a794095806311 | Task1 | Case Description | @@SYS_NEXT_USER_TO_BE_ASSIGNED | template.html | TRUE | BALANCED | @@USER_LOGGED | @@GROUP_UID | 1 | 2 | DAYS | | FALSE | 2 | DAYS | 2 | | ADHOC | Case Title | Case Description | INPUT | Titulo de Notificacion 1| template | Esta es una Notificacion | template.html | tas_send_last_email | - | Invalid tas_def_message_type | 95655319552a5c790b69a04054667879 | Task2 | Case Description | @@SYS_NEXT_USER_TO_BE_ASSIGNED | template.html | TRUE | BALANCED | @@USER_LOGGED | @@GROUP_UID | 1 | 2 | DAYS | | FALSE | 2 | DAYS | 2 | | ADHOC | Case Title | Case Description | FALSE | Titulo de Notificacion 1| INPUT | Esta es una Notificacion | template.html | tas_def_message_type | \ No newline at end of file + | Invalid tas_def_message_type | 95655319552a5c790b69a04054667879 | Task2 | Case Description | @@SYS_NEXT_USER_TO_BE_ASSIGNED | template.html | TRUE | BALANCED | @@USER_LOGGED | @@GROUP_UID | 1 | 2 | DAYS | | FALSE | 2 | DAYS | 2 | | ADHOC | Case Title | Case Description | TRUE | Titulo de Notificacion 1| INPUT | Esta es una Notificacion | template.html | tas_def_message_type | \ No newline at end of file diff --git a/features/backend/files_manager/main_test_files_manager.feature b/features/backend/files_manager/main_test_files_manager.feature index d457b9e44..ae851cb1c 100644 --- a/features/backend/files_manager/main_test_files_manager.feature +++ b/features/backend/files_manager/main_test_files_manager.feature @@ -1,9 +1,13 @@ @ProcessMakerMichelangelo @RestAPI -Feature: Files Manager Resources +Feature: Files Manager Resources Main Tests + Requirements: + a workspace with the process 4224292655297723eb98691001100052 ("Test Users-Step-Properties End Point") already loaded + there are two output documents in the process Background: Given that I have a valid access_token + Scenario: Get a list of main process files manager Given I request "project/1265557095225ff5c688f46031700471/file-manager" Then the response status code should be 200 @@ -42,55 +46,52 @@ Feature: Files Manager Resources And store "prf_uid" in session array as variable "prf_uid" Examples: - | test_description | file_name | path | content | http_code | type | - | into public folder | testbehat.txt | public/ | test | 200 | object | - | into maintemplates folder | testbehat.txt | templates/ | test | 200 | object | - | into public subfolder | testbehat.txt | public/test_folder | test | 200 | object | - | into public subfolder | testbehat.txt | templates/test_folder | test | 200 | object | + | test_description | file_name | path | content | http_code | type | i | + | into public folder | testbehat1.txt | public/ | test | 200 | object | 0 | + | into mailtemplates folder | testbehat1.txt | templates/ | test | 200 | object | 1 | + | into public subfolder | testbehat1.txt | public/test_folder | test | 200 | object | 2 | + | into mailtemplates subfolder | testbehat1.txt | templates/test_folder | test | 200 | object | 3 | Scenario Outline: Post files Given PUT this data: """ { - "prf_filename": "", "prf_content": "" } """ - And I request "project/1265557095225ff5c688f46031700471/file-manager?path=" + And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid" + And I request "project/1265557095225ff5c688f46031700471/file-manager" Then the response status code should be And the response charset is "UTF-8" And the content type is "application/json" And the type is "" Examples: - | test_description | file_name | path | content | http_code | type | - | put into public folder | testbehat.txt | public/ | put test | 200 | object | - | put into maintemplates folder | testbehat.txt | templates/ | put test | 200 | object | - | put into public subfolder | testbehat.txt | public/test_folder | put test | 200 | object | - | put into public subfolder | testbehat.txt | templates/test_folder | put test | 200 | object | - + | test_description | content | http_code | type | i | + | put into public folder | put test | 200 | object | 0 | + | put into mailtemplates folder | put test | 200 | object | 1 | + | put into public subfolder | put test | 200 | object | 2 | + | put into mailtemplates subfolder | put test | 200 | object | 3 | Scenario Outline: Delete file - Given that I want to delete a "" - And I request "project/1265557095225ff5c688f46031700471/file-manager?path=" - And the content type is "application/json" + Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid" + And I request "project/1265557095225ff5c688f46031700471/file-manager" Then the response status code should be 200 And the response charset is "UTF-8" Examples: - | test_description | path | - | delete public folder | public/testbehat.txt | - | delete maintemplates folder | templates/testbehat.txt | - | delete public subfolder | public/test_folder/testbehat.txt | - | delete public subfolder | templates/test_folder/testbehat.txt | + | test_description | i | + | delete public folder | 0 | + | delete mailtemplates folder | 1 | + | delete public subfolder | 2 | + | delete mailtemplates subfolder | 3 | #Para que funcione este test, debe existir el archivo que se quiere subir Scenario: Post files - Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "project/1265557095225ff5c688f46031700471/file-manager" and updload "project/1265557095225ff5c688f46031700471/file-manager/upload" + Given POST I want to upload the file "/home/daniel/test.txt" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager" Scenario: Delete file - Given that I want to delete a "public/test.txt" - And I request "project/1265557095225ff5c688f46031700471/file-manager?path=public/test.txt" - And the content type is "application/json" + Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid" + And I request "project/1265557095225ff5c688f46031700471/file-manager" Then the response status code should be 200 - And the response charset is "UTF-8" \ No newline at end of file + And the response charset is "UTF-8" diff --git a/features/backend/process_supervisor/main_tests_supervisor.feature b/features/backend/process_supervisor/main_tests_supervisor.feature index ec7f35260..a8b26430c 100644 --- a/features/backend/process_supervisor/main_tests_supervisor.feature +++ b/features/backend/process_supervisor/main_tests_supervisor.feature @@ -214,7 +214,7 @@ Requirements: """ And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform" Then the response status code should be 400 - And the response status message should have the following text "already exists" + And the response status message should have the following text "already exist" diff --git a/features/backend/trigger_wizard/main_tests_trigger_wizards.feature b/features/backend/trigger_wizard/main_tests_trigger_wizards.feature new file mode 100644 index 000000000..e69de29bb diff --git a/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature b/features/backend/trigger_wizard/negative_tests_triggers_wizards.feature new file mode 100644 index 000000000..e69de29bb From 807cd6fbbc0427713de05a8f42cc1d0758f638cb Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Wed, 5 Mar 2014 09:58:35 -0400 Subject: [PATCH 2/3] Avance del feature file manager y correccion en el archivo rest debido a las variables de la respuesta json no estaban presentes como cuando se hace POST, tambien se hizo modificaciones a los features activity, trigger wizard --- .../activity/main_tests_activity.feature | 2 +- .../main_test_files_manager.feature | 72 ++++--- .../negative_tests_files_manager.feature | 6 + .../main_tests_process_variables.feature | 0 .../negative_tests_process_variables.feature | 0 .../basic_sequence_trigger_wizard.feature | 173 +++++++++++++++++ .../main_tests_trigger_wizards.feature | 176 ++++++++++++++++++ features/bootstrap/RestContext.php | 28 ++- 8 files changed, 421 insertions(+), 36 deletions(-) create mode 100644 features/backend/process_variables/main_tests_process_variables.feature create mode 100644 features/backend/process_variables/negative_tests_process_variables.feature create mode 100644 features/backend/trigger_wizard/basic_sequence_trigger_wizard.feature diff --git a/features/backend/activity/main_tests_activity.feature b/features/backend/activity/main_tests_activity.feature index 8dbc01fd4..09e2e7256 100644 --- a/features/backend/activity/main_tests_activity.feature +++ b/features/backend/activity/main_tests_activity.feature @@ -121,7 +121,7 @@ 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_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 ae851cb1c..5b9e54236 100644 --- a/features/backend/files_manager/main_test_files_manager.feature +++ b/features/backend/files_manager/main_test_files_manager.feature @@ -1,7 +1,7 @@ @ProcessMakerMichelangelo @RestAPI Feature: Files Manager Resources Main Tests Requirements: - a workspace with the process 4224292655297723eb98691001100052 ("Test Users-Step-Properties End Point") already loaded + a workspace with the process 1265557095225ff5c688f46031700471 ("Test Michelangelo") already loaded there are two output documents in the process Background: @@ -14,6 +14,8 @@ 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 "name" property in row 0 equals "templates" + And the "name" property in row 1 equals "public" Scenario: Get a list public folder of process files manager Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=public" @@ -21,6 +23,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 0 records Scenario: Get a list templates folder of process files manager Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates" @@ -28,8 +31,9 @@ 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 - Scenario Outline: Post files + Scenario Outline: Create files and subfolders Given POST this data: """ { @@ -43,14 +47,14 @@ Feature: Files Manager Resources Main Tests And the response charset is "UTF-8" And the content type is "application/json" And the type is "" - And store "prf_uid" in session array as variable "prf_uid" + And store "prf_uid" in session array as variable "prf_uid_" Examples: - | test_description | file_name | path | content | http_code | type | i | - | into public folder | testbehat1.txt | public/ | test | 200 | object | 0 | - | into mailtemplates folder | testbehat1.txt | templates/ | test | 200 | object | 1 | - | into public subfolder | testbehat1.txt | public/test_folder | test | 200 | object | 2 | - | into mailtemplates subfolder | testbehat1.txt | templates/test_folder | test | 200 | object | 3 | + | test_description | file_name | path | content | http_code | type | prf_number | + | into public folder | file_test_1.txt | public/ | only text | 200 | object | 0 | + | into mailtemplates folder | file_test_2.html | templates/ |

Test

html test

| 200 | object | 1 | + | into public subfolder | file_test_3.txt | public/public_subfolder | test | 200 | object | 2 | + | into mailtemplates subfolder | file_test_4.html | templates/templates_subfolder | test | 200 | object | 3 | Scenario Outline: Post files Given PUT this data: @@ -59,7 +63,7 @@ Feature: Files Manager Resources Main Tests "prf_content": "" } """ - And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid" + And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid_" And I request "project/1265557095225ff5c688f46031700471/file-manager" Then the response status code should be And the response charset is "UTF-8" @@ -67,31 +71,41 @@ Feature: Files Manager Resources Main Tests And the type is "" Examples: - | test_description | content | http_code | type | i | - | put into public folder | put test | 200 | object | 0 | - | put into mailtemplates folder | put test | 200 | object | 1 | - | put into public subfolder | put test | 200 | object | 2 | - | put into mailtemplates subfolder | put test | 200 | object | 3 | + | test_description | content | http_code | type | prf_number | + | put into public folder | only text - modified | 200 | object | 0 | + | put into mailtemplates folder |

Test

html test

modified | 200 | object | 1 | + | put into public subfolder | put test | 200 | object | 2 | + | put into mailtemplates subfolder | put test | 200 | object | 3 | + + #Para que funcione este test, debe existir el archivo que se quiere subir + 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 | path | prf_number | + |/home/daniel/test1.html | templates | 4 | + |/home/daniel/test2.html | templates | 5 | + |/home/daniel/test.txt | public | 6 | + Scenario Outline: Delete file - Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid" - And I request "project/1265557095225ff5c688f46031700471/file-manager" + Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid_" + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 200 And the response charset is "UTF-8" Examples: - | test_description | i | - | delete public folder | 0 | - | delete mailtemplates folder | 1 | - | delete public subfolder | 2 | - | delete mailtemplates subfolder | 3 | + | 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 | - #Para que funcione este test, debe existir el archivo que se quiere subir - Scenario: Post files - Given POST I want to upload the file "/home/daniel/test.txt" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager" + - Scenario: Delete file - Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid" - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 200 - And the response charset is "UTF-8" + \ No newline at end of file diff --git a/features/backend/files_manager/negative_tests_files_manager.feature b/features/backend/files_manager/negative_tests_files_manager.feature index e69de29bb..9af8ac0e5 100644 --- a/features/backend/files_manager/negative_tests_files_manager.feature +++ b/features/backend/files_manager/negative_tests_files_manager.feature @@ -0,0 +1,6 @@ +# get a list of an inexistent path +# try to create a file with same name as an existent +# try to upload a file with same name as an existent +# how to get content if a file +# how to delete sub folders +# upload bi files \ No newline at end of file diff --git a/features/backend/process_variables/main_tests_process_variables.feature b/features/backend/process_variables/main_tests_process_variables.feature new file mode 100644 index 000000000..e69de29bb diff --git a/features/backend/process_variables/negative_tests_process_variables.feature b/features/backend/process_variables/negative_tests_process_variables.feature new file mode 100644 index 000000000..e69de29bb diff --git a/features/backend/trigger_wizard/basic_sequence_trigger_wizard.feature b/features/backend/trigger_wizard/basic_sequence_trigger_wizard.feature new file mode 100644 index 000000000..916ffaccf --- /dev/null +++ b/features/backend/trigger_wizard/basic_sequence_trigger_wizard.feature @@ -0,0 +1,173 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Group + Requirements: + a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded + there are three activities in the process + + Background: + Given that I have a valid access_token + + #GET /api/1.0/{workspace}/project/{prj_uid}/trigger-wizards + # Get list Trigger Wizards + Scenario Outline: Get list Trigger Wizards + And I request "project/14414793652a5d718b65590036026581/trigger-wizards" + 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 "lib_name" property in row equals "" + And the "lib_title" property in row equals "" + 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 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/trigger-wizard/{lib_name} + # Get a single Library + Scenario Outline: Get a single Library + 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" + And that "lib_name" is set to "" + And that "lib_title" is set to "" + And that "lib_class_name" is set to "" + + Examples: + | lib_name | lib_title | lib_class_name | + | pmFunctions | ProcessMaker Functions | class.pmFunctions.php | + + #GET /api/1.0/{workspace}/project/{prj_uid}/trigger-wizard/{lib_name}/{fn_name} + # Get a single Function of the Library + Scenario Outline: Get a single Function of the Library + 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" + And that "fn_name" is set to "" + And that "fn_label" is set to "" + + Examples: + | lib_name | fn_name | fn_label | + | pmFunctions | PMFAddAttachmentToArray | Add Element in Array | + + #GET /api/1.0/{workspace}/project/{prj_uid}/triggers + # Get a List of triggers of a project + Scenario: Get a List of triggers of a project + And I request "project/14414793652a5d718b65590036026581/triggers" + 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 json data is an empty array + + #POST /api/1.0/{workspace}/project/{prj_uid}/trigger-wizard/{lib_name}/{fn_name} + # Create new Trigger + Scenario Outline: Create new Trigger + Given POST this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_params": { + "input": { + "arrayData": "", + "index": "", + "value": "", + "suffix": "" + }, + "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.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 | + + #PUT /api/1.0/{workspace}/project/{prj_uid}/trigger-wizard/{lib_name}/{fn_name}/{tri_uid} + # Update Trigger + Scenario Outline: Update Trigger + Given PUT this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_params": { + "input": { + "arrayData": "", + "index": "", + "value": "", + "suffix": "" + }, + "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.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 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/trigger-wizard/{lib_name}/{fn_name}/{tri_uid} + # Get a Trigger that was created with the wizard + 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" + 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" + And that "tri_title" is set to "" + And that "tri_description" is set to "" + 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 | + + #DELETE /api/1.0/{workspace}/project/{prj_uid}/trigger/{tri_uid} + # Delete a trigger of a project + Scenario Outline: Delete a trigger of a project + Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid" + And I request "project/14414793652a5d718b65590036026581/trigger" + 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 | + | 0 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/triggers + # Get a List of triggers of a project + Scenario: Get a List of triggers of a project + And I request "project/14414793652a5d718b65590036026581/triggers" + 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 json data is an empty array + diff --git a/features/backend/trigger_wizard/main_tests_trigger_wizards.feature b/features/backend/trigger_wizard/main_tests_trigger_wizards.feature index e69de29bb..d5a1a567f 100644 --- a/features/backend/trigger_wizard/main_tests_trigger_wizards.feature +++ b/features/backend/trigger_wizard/main_tests_trigger_wizards.feature @@ -0,0 +1,176 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Group + Requirements: + a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded + there are three activities in the process + + Background: + Given that I have a valid access_token + + + Scenario Outline: Get the Trigger Wizards 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 + And the response charset is "UTF-8" + And the type is "array" + And the response has 6 records + And the "lib_name" property in row equals "" + And the "lib_title" property in row equals "" + 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 | + + + Scenario Outline: Get a single Library + 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" + And that "lib_name" is set to "" + And that "lib_title" is set to "" + And that "lib_class_name" is set to "" + + Examples: + | lib_name | lib_title | lib_class_name | + | pmFunctions | ProcessMaker Functions | class.pmFunctions.php | + | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php | + | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php | + | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php | + | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php | + | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php | + + + Scenario Outline: Get a single Function of the Library + 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" + And that "fn_name" is set to "" + And that "fn_label" is set to "" + + Examples: + | lib_name | fn_name | fn_label | + | pmFunctions | PMFAddAttachmentToArray | Add Element in Array | + | pmTrSharepoint | createDWS | Create a DWS in Sharepoint server | + | pmTrAlfresco | Checkin | Checkin document/file | + | pmZimbra | createZimbraAppointment | Create Appointment | + | pmTalend | executeTalendWebservice | Executes a Talend Web Service | + | 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" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the json data is an empty array + + + Scenario Outline: Create new Trigger + Given POST this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_params": { + "input": { + "arrayData": "", + "index": "", + "value": "", + "suffix": "" + }, + "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.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 | + + + Scenario Outline: Update Trigger + Given PUT this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_params": { + "input": { + "arrayData": "", + "index": "", + "value": "", + "suffix": "" + }, + "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.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: 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" + 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" + And that "tri_title" is set to "" + And that "tri_description" is set to "" + 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 | + + + Scenario Outline: Delete a trigger of a project + Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid" + And I request "project/14414793652a5d718b65590036026581/trigger" + 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 | + | 0 | + + + Scenario: Get a List of triggers of a project + And I request "project/14414793652a5d718b65590036026581/triggers" + 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 json data is an empty array \ No newline at end of file diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 8f0051c5c..c8c00b112 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1186,6 +1186,7 @@ class RestContext extends BehatContext } $this->_restDeleteQueryStringSuffix = "/" . $varValue; + $this->_restObjectMethod = 'delete'; } @@ -1249,7 +1250,7 @@ class RestContext extends BehatContext } else { $varValue = $sessionData->$sessionVarName; } - +print_r($sessionData); $pageUrl = str_replace($varName, $varValue, $pageUrl); @@ -1332,12 +1333,24 @@ class RestContext extends BehatContext curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch); + curl_close($ch); + + //Save result as usual + $this->_type = 'json'; + $this->_data = json_decode($postResult); + $postResult = (array)json_decode($postResult); + + + + + if (sizeof($postResult) > 2) { $prfUid = $postResult["prf_uid"]; } else { - var_dump($postResult["error"]); + throw new Exception($postResult["error"]->message); + //var_dump($postResult["error"]); } $url = $url.'/'.$prfUid."/upload"; $ch = curl_init(); @@ -1350,10 +1363,13 @@ class RestContext extends BehatContext curl_close($ch); //se guarda el prf_uid en una variable - $varName = 'prf_uid'; - $sessionData = new StdClass(); - $sessionData->$varName = $prfUid; - file_put_contents("session.data", json_encode($sessionData)); + + //Wen: Esto borra todo el session data, por favor corregir o no guardar la variable desde aca + + //$varName = 'prf_uid'; + //$sessionData = new StdClass(); + //$sessionData->$varName = $prfUid; + //file_put_contents("session.data", json_encode($sessionData)); } //UPLOAD IMAGE From 95de259f486c0e54bcd5803a8705115f65dcc2e3 Mon Sep 17 00:00:00 2001 From: Omar Date: Wed, 5 Mar 2014 10:15:14 -0400 Subject: [PATCH 3/3] index.html updated, some classes were added also the resizeFrame function was implemented on the body event --- workflow/engine/templates/designer/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index c68a65802..8a02906fa 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -99,7 +99,7 @@ {/if} - +