Avance del feature export/import projects, y modificacion de la funcion para realizar upload

This commit is contained in:
Wendy Nestor
2014-05-12 12:28:01 -04:00
parent 1843cae639
commit 2532ea7460
2 changed files with 272 additions and 150 deletions

View File

@@ -18,20 +18,20 @@ Scenario: Get for Export Project
#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. #Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc.
Scenario: Get a List DynaForms of a Project Process Complete BPMN Scenario: Get a List DynaForms of a Project Process Complete BPMN
Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 26 records And the response has 26 records
Scenario: Get the Input Documents List when there are exactly zero input documents Scenario: Get the Input Documents List when there are exactly zero input documents
Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" Given I request "project/1455892245368ebeb11c1a5001393784/input-documents"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And the response has 1 records
Scenario: Get the Output Documents List when there are exactly two output documents Scenario: Get the Output Documents List when there are exactly two output documents
Given I request "project/1455892245368ebeb11c1a5001393784/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 And the response has 1 records
Scenario: Get the Triggers List when there are exactly two triggers Scenario: Get the Triggers List when there are exactly two triggers
Given I request "project/1455892245368ebeb11c1a5001393784/triggers" Given I request "project/1455892245368ebeb11c1a5001393784/triggers"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 3 records And the response has 3 records
Scenario Outline: List assignees of each activity Scenario Outline: List assignees of each activity
Given I request "project/1455892245368ebeb11c1a5001393784/activity/<activity>/assignee" Given I request "project/1455892245368ebeb11c1a5001393784/activity/<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 | | 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 Scenario: Get a List of current process supervisors of a project
Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records And the response has 1 records
Scenario: Get a List of current Process Permissions of a project Scenario: Get a List of current Process Permissions of a project
Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the response has 1 record And the response has 1 record
Scenario: Get a list templates folder of process files manager 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 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" 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 And the response has 1 records
Scenario: Get a single Process Scenario: Get a single Process
Given that I want to get a resource with the key "obj_uid" stored in session array Given that I want to get a resource with the key "obj_uid" stored in session array
And I request "project/1455892245368ebeb11c1a5001393784/process" And I request "project/1455892245368ebeb11c1a5001393784/process"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
And that "pro_title" is set to "Process Complete BPMN" And that "pro_title" is set to "Process Complete BPMN"
And that "pro_description" is set to "" And that "pro_description" is set to ""
And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784"
And that "pro_time" is set to 1 And that "pro_time" is set to 1
And that "pro_timeunit" is set to "DAYS" And that "pro_timeunit" is set to "DAYS"
And that "pro_status" is set to "ACTIVE" And that "pro_status" is set to "ACTIVE"
And that "pro_type_day" is set to "" And that "pro_type_day" is set to ""
And that "pro_type" is set to "NORMAL" And that "pro_type" is set to "NORMAL"
And that "pro_assignment" is set to 0 And that "pro_assignment" is set to 0
And that "pro_show_map" 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_show_message" is set to 1
And that "pro_subprocess" is set to 0 And that "pro_subprocess" is set to 0
And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679"
And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052"
And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" And that "pro_tri_paused" is set to "350949312536bea73c53791057971272"
And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679"
And that "pro_show_delegate" is set to 0 And that "pro_show_delegate" is set to 0
And that "pro_show_dynaform" is set to 0 And that "pro_show_dynaform" is set to 0
And that "pro_category" is set to "4177095085330818c324501061677193" And that "pro_category" is set to "4177095085330818c324501061677193"
And that "pro_sub_category" is set to "" And that "pro_sub_category" is set to ""
And that "pro_industry" is set to 0 And that "pro_industry" is set to 0
And that "pro_update_date" is set to "null" 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_date" is set to "2014-05-06 10:04:27"
And that "pro_create_user" is set to "00000000000000000000000000000001" And that "pro_create_user" is set to "00000000000000000000000000000001"
And that "pro_debug" is set to 0 And that "pro_debug" is set to 0
And that "pro_derivation_screen_tpl" is set to "" And that "pro_derivation_screen_tpl" is set to ""
And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553"
And that "pro_calendar" is set to "14606161052f50839307899033145440" And that "pro_calendar" is set to "14606161052f50839307899033145440"
#Import Process #Import Process
@@ -130,52 +130,85 @@ Scenario Outline: Import a process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "object"
And store "prj_uid" in session array as variable "prj_uid_<prj_uid_number>"
Examples: Examples:
| project_file | import_option | | project_file | import_option | prj_uid_number |
| /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | create | | /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | create | 1 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | overwrite | | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | overwrite | 2 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | disable | | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | disable | 3 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | keep | | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | keep | 4 |
#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. #Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc.
Scenario: Get a List DynaForms of a Project Process Complete BPMN Scenario Outline: Get a List DynaForms of a Project Process Complete BPMN
Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" Given I request "project/prj_uid/dynaforms" with the key "prj_uid" stored in session array as variable "prj_uid_<prj_uid_number>"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 26 records And the response has <records> 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" Scenario Outline: Get the Input Documents List when there are exactly zero input documents
And the content type is "application/json" Given I request "project/prj_uid/input-documents" with the key "prj_uid" stored in session array as variable "prj_uid_<prj_uid_number>"
Then the response status code should be 200 And the content type is "application/json"
And the response charset is "UTF-8" Then the response status code should be 200
And the type is "array" And the response charset is "UTF-8"
And the response has 1 records And the type is "array"
And the response has <records> 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_<prj_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> 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 Scenario Outline: Get the Triggers List when there are exactly two triggers
Given I request "project/1455892245368ebeb11c1a5001393784/triggers" Given I request "project/prj_uid/triggers" with the key "prj_uid" stored in session array as variable "prj_uid_<prj_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 3 records And the response has <records> 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 Scenario Outline: List assignees of each activity
Given I request "project/1455892245368ebeb11c1a5001393784/activity/<activity>/assignee" Given I request "project/prj_uid/activity/<activity>/assignee" with the key "prj_uid" stored in session array as variable "prj_uid_<prj_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" 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 "<aas_type>" And the "aas_type" property in row 0 equals "<aas_type>"
Examples: Examples:
| test_description | project | activity | records | aas_uid | aas_type | | import_option | prj_uid_number | prj_uid | records | project | activity | records | aas_uid | aas_type |
| Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | 601816709536cfeae7d7cd9079578104 | 771350954536cfec446fab9019867857 | 1 | 70084316152d56749e0f393054862525 | group |
| Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 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 Scenario Outline: Get a List of current process supervisors of a project
Given I request "project/1455892245368ebeb11c1a5001393784/file-manager?path=templates" Given I request "project/prj_uid/process-supervisors" stored in session array as variable "prj_uid_<prj_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> records
Scenario: Get a single Process Examples:
Given that I want to get a resource with the key "obj_uid" stored in session array | import_option | prj_uid_number | prj_uid | records |
And I request "project/1455892245368ebeb11c1a5001393784/process" | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 |
And the content type is "application/json" | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 |
Then the response status code should be 200 | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 |
And the response charset is "UTF-8" | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 |
And the type is "object"
And that "pro_title" is set to "Process Complete BPMN"
And that "pro_description" is set to "" Scenario Outline: Get a List of current Process Permissions of a project
And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" Given I request "project/prj_uid/process-permissions" stored in session array as variable "prj_uid_<prj_uid_number>"
And that "pro_time" is set to 1 Then the response status code should be 200
And that "pro_timeunit" is set to "DAYS" And the response charset is "UTF-8"
And that "pro_status" is set to "ACTIVE" And the response has <records> records
And that "pro_type_day" is set to ""
And that "pro_type" is set to "NORMAL" Examples:
And that "pro_assignment" is set to 0 | import_option | prj_uid_number | prj_uid | records |
And that "pro_show_map" is set to 0 | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 |
And that "pro_show_message" is set to 1 | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 |
And that "pro_subprocess" is set to 0 | disable | 3 | 1455892245368ebeb11c1a5001393784 | 1 |
And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" | keep | 4 | 1455892245368ebeb11c1a5001393784 | 1 |
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" Scenario Outline: Get a list templates folder of process files manager
And that "pro_show_delegate" is set to 0 Given I request "project/prj_uid/file-manager?path=templates" stored in session array as variable "prj_uid_<prj_uid_number>"
And that "pro_show_dynaform" is set to 0 Then the response status code should be 200
And that "pro_category" is set to "4177095085330818c324501061677193" And the response charset is "UTF-8"
And that "pro_sub_category" is set to "" And the content type is "application/json"
And that "pro_industry" is set to 0 And the type is "array"
And that "pro_update_date" is set to "null" And the response has <records> records
And that "pro_create_date" is set to "2014-05-06 10:04:27"
And that "pro_create_user" is set to "00000000000000000000000000000001" Examples:
And that "pro_debug" is set to 0 | import_option | prj_uid_number | prj_uid | records |
And that "pro_derivation_screen_tpl" is set to "" | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 |
And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" | overwrite | 2 | 1455892245368ebeb11c1a5001393784 | 1 |
And that "pro_calendar" is set to "14606161052f50839307899033145440" | 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_<prj_uid_number>"
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"

View File

@@ -1531,9 +1531,9 @@ class RestContext extends BehatContext
/** /**
* @Given /^POST upload a project file "([^"]*)" to "([^"]*)"$/ * @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; $postFields->project_file ='@'.$file;
$this->_restObjectMethod = 'post'; $this->_restObjectMethod = 'post';