From 2532ea7460f3b6b7adcfc2d0ae3f8bb8343f16e7 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Mon, 12 May 2014 12:28:01 -0400 Subject: [PATCH] Avance del feature export/import projects, y modificacion de la funcion para realizar upload --- .../main_tests_project_export_import.feature | 418 +++++++++++------- features/bootstrap/RestContext.php | 4 +- 2 files changed, 272 insertions(+), 150 deletions(-) diff --git a/features/backend/projects/project_export_import/main_tests_project_export_import.feature b/features/backend/projects/project_export_import/main_tests_project_export_import.feature index c503c3b57..58aaac42d 100644 --- a/features/backend/projects/project_export_import/main_tests_project_export_import.feature +++ b/features/backend/projects/project_export_import/main_tests_project_export_import.feature @@ -18,20 +18,20 @@ Scenario: Get for Export Project #Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. Scenario: Get a List DynaForms of a Project Process Complete BPMN - Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" - 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 26 records + Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" + 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 26 records Scenario: Get the Input Documents List when there are exactly zero input documents - Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" - 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 1 records + Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" + 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 1 records Scenario: Get the Output Documents List when there are exactly two output documents Given I request "project/1455892245368ebeb11c1a5001393784/output-documents" @@ -42,12 +42,12 @@ Scenario: Get the Output Documents List when there are exactly two output docume And the response has 1 records Scenario: Get the Triggers List when there are exactly two triggers - Given I request "project/1455892245368ebeb11c1a5001393784/triggers" - 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 response has 3 records + Given I request "project/1455892245368ebeb11c1a5001393784/triggers" + 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 response has 3 records Scenario Outline: List assignees of each activity Given I request "project/1455892245368ebeb11c1a5001393784/activity//assignee" @@ -65,21 +65,21 @@ Scenario Outline: List assignees of each activity | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | Scenario: Get a List of current process supervisors of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" - 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 response has 1 records + Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" + 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 response has 1 records Scenario: Get a List of current Process Permissions of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has 1 record + Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 1 record Scenario: Get a list templates folder of process files manager - Given I request "project/1455892245368ebeb11c1a5001393784/file-manager?path=templates" + Given I request "project/1455892245368ebeb11c1a5001393784/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" @@ -87,40 +87,40 @@ Scenario: Get a list templates folder of process files manager And the response has 1 records Scenario: Get a single Process - Given that I want to get a resource with the key "obj_uid" stored in session array - And I request "project/1455892245368ebeb11c1a5001393784/process" - 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 "pro_title" is set to "Process Complete BPMN" - And that "pro_description" is set to "" - And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" - And that "pro_time" is set to 1 - And that "pro_timeunit" is set to "DAYS" - And that "pro_status" is set to "ACTIVE" - And that "pro_type_day" is set to "" - And that "pro_type" is set to "NORMAL" - And that "pro_assignment" is set to 0 - And that "pro_show_map" is set to 0 - And that "pro_show_message" is set to 1 - And that "pro_subprocess" is set to 0 - And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" - And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" - And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" - And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" - And that "pro_show_delegate" is set to 0 - And that "pro_show_dynaform" is set to 0 - And that "pro_category" is set to "4177095085330818c324501061677193" - And that "pro_sub_category" is set to "" - And that "pro_industry" is set to 0 - And that "pro_update_date" is set to "null" - And that "pro_create_date" is set to "2014-05-06 10:04:27" - And that "pro_create_user" is set to "00000000000000000000000000000001" - And that "pro_debug" is set to 0 - And that "pro_derivation_screen_tpl" is set to "" - And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" - And that "pro_calendar" is set to "14606161052f50839307899033145440" + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/1455892245368ebeb11c1a5001393784/process" + 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 "pro_title" is set to "Process Complete BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 1 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" + And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" + And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" + And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "4177095085330818c324501061677193" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-06 10:04:27" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" + And that "pro_calendar" is set to "14606161052f50839307899033145440" #Import Process @@ -130,52 +130,85 @@ Scenario Outline: Import a process And the response charset is "UTF-8" And the content type is "application/json" And the type is "object" + And store "prj_uid" in session array as variable "prj_uid_" Examples: - | project_file | import_option | - | /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | create | - | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | overwrite | - | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | disable | - | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | keep | - + | project_file | import_option | prj_uid_number | + | /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | create | 1 | + | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | overwrite | 2 | + | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | disable | 3 | + | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | keep | 4 | + #Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. -Scenario: Get a List DynaForms of a Project Process Complete BPMN - Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" - 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 26 records +Scenario Outline: Get a List DynaForms of a Project Process Complete BPMN + Given I request "project/prj_uid/dynaforms" with the key "prj_uid" stored in session array as variable "prj_uid_" + 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 records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 2 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 26 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 26 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 26 | - Scenario: Get the Input Documents List when there are exactly zero input documents - Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" - 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 1 records + +Scenario Outline: Get the Input Documents List when there are exactly zero input documents + Given I request "project/prj_uid/input-documents" with the key "prj_uid" stored in session array as variable "prj_uid_" + 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 records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 | -Scenario: Get the Output Documents List when there are exactly two output documents - Given I request "project/1455892245368ebeb11c1a5001393784/output-documents" + +Scenario Outline: Get the Output Documents List when there are exactly two output documents + Given I request "project/prj_uid/output-documents" with the key "prj_uid" stored in session array as variable "prj_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 "array" - And the response has 1 records + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + -Scenario: Get the Triggers List when there are exactly two triggers - Given I request "project/1455892245368ebeb11c1a5001393784/triggers" - 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 response has 3 records +Scenario Outline: Get the Triggers List when there are exactly two triggers + Given I request "project/prj_uid/triggers" with the key "prj_uid" stored in session array as variable "prj_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 "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 3 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 3 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 3 | + Scenario Outline: List assignees of each activity - Given I request "project/1455892245368ebeb11c1a5001393784/activity//assignee" + Given I request "project/prj_uid/activity//assignee" with the key "prj_uid" stored in session array as variable "prj_uid_" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" @@ -185,64 +218,153 @@ Scenario Outline: List assignees of each activity And the "aas_type" property in row 0 equals "" Examples: - | test_description | project | activity | records | aas_uid | aas_type | - | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | - | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | + | import_option | prj_uid_number | prj_uid | records | project | activity | records | aas_uid | aas_type | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | 601816709536cfeae7d7cd9079578104 | 771350954536cfec446fab9019867857 | 1 | 70084316152d56749e0f393054862525 | group | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | 1 | 70084316152d56749e0f393054862525 | group | -Scenario: Get a List of current process supervisors of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" - 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 response has 1 records - -Scenario: Get a List of current Process Permissions of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has 1 record -Scenario: Get a list templates folder of process files manager - Given I request "project/1455892245368ebeb11c1a5001393784/file-manager?path=templates" +Scenario Outline: Get a List of current process supervisors of a project + Given I request "project/prj_uid/process-supervisors" stored in session array as variable "prj_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 "array" - And the response has 1 records + And the response has records -Scenario: Get a single Process - Given that I want to get a resource with the key "obj_uid" stored in session array - And I request "project/1455892245368ebeb11c1a5001393784/process" - 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 "pro_title" is set to "Process Complete BPMN" - And that "pro_description" is set to "" - And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" - And that "pro_time" is set to 1 - And that "pro_timeunit" is set to "DAYS" - And that "pro_status" is set to "ACTIVE" - And that "pro_type_day" is set to "" - And that "pro_type" is set to "NORMAL" - And that "pro_assignment" is set to 0 - And that "pro_show_map" is set to 0 - And that "pro_show_message" is set to 1 - And that "pro_subprocess" is set to 0 - And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" - And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" - And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" - And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" - And that "pro_show_delegate" is set to 0 - And that "pro_show_dynaform" is set to 0 - And that "pro_category" is set to "4177095085330818c324501061677193" - And that "pro_sub_category" is set to "" - And that "pro_industry" is set to 0 - And that "pro_update_date" is set to "null" - And that "pro_create_date" is set to "2014-05-06 10:04:27" - And that "pro_create_user" is set to "00000000000000000000000000000001" - And that "pro_debug" is set to 0 - And that "pro_derivation_screen_tpl" is set to "" - And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" - And that "pro_calendar" is set to "14606161052f50839307899033145440" \ No newline at end of file + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get a List of current Process Permissions of a project + Given I request "project/prj_uid/process-permissions" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get a list templates folder of process files manager + Given I request "project/prj_uid/file-manager?path=templates" stored in session array as variable "prj_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 "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario: Get a single Process process "Process Complete BPMN" + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/1455892245368ebeb11c1a5001393784/process" + 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 "pro_title" is set to "Process Complete BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 1 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" + And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" + And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" + And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "4177095085330818c324501061677193" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-06 10:04:27" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" + And that "pro_calendar" is set to "14606161052f50839307899033145440" + + +Scenario: Get a single Process process "Process NewCreate BPMN" + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/601816709536cfeae7d7cd9079578104/process" + 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 "pro_title" is set to "Process NewCreate BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "601816709536cfeae7d7cd9079578104" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 0 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "" + And that "pro_tri_canceled" is set to "" + And that "pro_tri_paused" is set to "" + And that "pro_tri_reassigned" is set to "" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-12 09:10:23" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "" + And that "pro_calendar" is set to "" + + +Scenario Outline: Delete a Project created previously in this script + Given that I want to delete a resource with the key "prj_uid" stored in session array as variable "prj_uid_" + And I request "projects" + 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: + + | prj_uid_number | + | 1 | + | 2 | + | 3 | + | 4 | + + +Scenario: Get a list of projects + Given I request "project" + 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" \ No newline at end of file diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 6242ae333..ba7a8d63a 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1531,9 +1531,9 @@ class RestContext extends BehatContext /** * @Given /^POST upload a project file "([^"]*)" to "([^"]*)"$/ */ - public function postUploadAProjectFile($file, $url, PyStringNode $string) + public function postUploadAProjectFile($file, $url) { - $postFields = json_decode($string); + $postFields = new StdClass(); $postFields->project_file ='@'.$file; $this->_restObjectMethod = 'post';