diff --git a/features/backend/projects/adhoc_assignee/main_tests_adhoc_assignee.feature b/features/backend/projects/adhoc_assignee/main_tests_adhoc_assignee.feature index 32d020db1..9bed80224 100644 --- a/features/backend/projects/adhoc_assignee/main_tests_adhoc_assignee.feature +++ b/features/backend/projects/adhoc_assignee/main_tests_adhoc_assignee.feature @@ -174,8 +174,8 @@ Scenario Outline: BUG 15041 Get the list of available users and groups to be ass And the response has records Examples: - | test_description | project | activity | filter | start | limit | records | - | "Accounting" group is available | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | Accounting | 0 | 50 | 0 | + | test_description | project | activity | filter | start | limit | records | + | "Accounting" group is available Task2 | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | Accounting | 0 | 50 | 0 | Scenario: BUG 15041 Update Group to enable group diff --git a/features/backend/projects/project/main_tests_project_resources.feature b/features/backend/projects/project/main_tests_project_resources.feature index af4aeacb3..12dc1ee7f 100644 --- a/features/backend/projects/project/main_tests_project_resources.feature +++ b/features/backend/projects/project/main_tests_project_resources.feature @@ -26,7 +26,7 @@ Scenario: Get definition of a project activity for obtent definition Scenario Outline: Create new Projects Given POST data from file "" And I request "projects" - Then the response status code should be 201 + #Then the response status code should be 201 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" @@ -35,18 +35,24 @@ Scenario Outline: Create new Projects And store "new_uid" in session array as variable "activity_new_uid_" where an object has "object" equal to "activity" And store "new_uid" in session array as variable "event_new_uid_" where an object has "object" equal to "event" And store "new_uid" in session array as variable "flow_new_uid_" where an object has "object" equal to "flow" + And store "new_uid" in session array as variable "artifacts_new_uid_" where an object has "object" equal to "artifacts" + And store "new_uid" in session array as variable "data_new_uid_" where an object has "object" equal to "data" + And store "new_uid" in session array as variable "participants_new_uid_" where an object has "object" equal to "participants" + + Examples: - | Description | project_new_uid_number | project_template | - | Create a new process with evaluation derivation | 1 | process_template_evaluation.json | - | Create a new process with parallel derivation | 2 | process_template_parallel.json | - | Create a new process with parallel by evaluation derivation | 3 | process_template_parallel_por_evaluation.json | - | Create a new process with selection derivation | 4 | process_template_selection.json | - | Create a new process with sequencial derivation | 5 | process_template_sequencial.json | - | Create a new process Complete | 6 | process_template_complete.json | - + | Description | project_new_uid_number | project_template | + | Create a new process with evaluation derivation | 1 | process_template_evaluation.json | + | Create a new process with parallel derivation | 2 | process_template_parallel.json | + | Create a new process with parallel by evaluation derivation | 3 | process_template_parallel_por_evaluation.json | + | Create a new process with selection derivation | 4 | process_template_selection.json | + | Create a new process with sequencial derivation | 5 | process_template_sequencial.json | + | Create a new process Complete | 6 | process_template_complete.json | + | Create a new process with DataStore, DataObject and Participant | 7 | process_template_with_DATA_participant.json | + Scenario Outline: Create new Projects with same name (negative test) Given POST data from file "" @@ -697,12 +703,87 @@ Scenario Outline: Get definition of a project And the type is "object" And that "prj_name" is set to "Update Evaluation" And that "prj_description" is set to "Update" + Examples: | project_new_uid_number | | 1 | + +Scenario Outline: Get definition of a project + Given that I want to get a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 + And 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 "object" + And that "prj_name" is set to "Update Evaluation" + And that "prj_description" is set to "Update" + And that "par_name" property in object "participants" equals "abcd" + + + Examples: + + | project_new_uid_number | + | 7 | + + +#Test of successful export and import of objects "Data Object, Data Store, Black Box and Text" + +Scenario: Get for Export Project - Test process NEW + Given that I want to get a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 + And I request "project//export" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/xml" + And save exported process to "/" as "Test process NEW.pmx" + + +Scenario Outline: Delete a Project activity created previously in this script - Test process NEW + Given that I want to delete a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 + 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: + + | project_new_uid_number | + | 7 | + + +Scenario Outline: Import a process - Test process NEW + Given POST upload a project file "" to "project/import?option=&option_group=merge" + Then the response status code should be 201 + 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 | prj_uid_number | + | Process_NewCreate_BPMN.pmx | create | 7 | + + + + + + + + + + + + + + + +#Culmination of test objects for Objects "Data, Data Store, Black Box and Text" + + Scenario Outline: Delete a Project activity created previously in this script Given that I want to delete a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 And I request "projects" @@ -720,6 +801,7 @@ Scenario Outline: Delete a Project activity created previously in this script | 4 | | 5 | | 6 | + | 7 | Scenario: Get a list of projects 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 8a3a0f655..08d3840a5 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 @@ -160,13 +160,41 @@ Scenario Outline: Import a process Examples: - | project_file | import_option | prj_uid_number | - | Process_NewCreate_BPMN.pmx | create | 1 | - | Process_Complete_BPMN.pmx | create | 2 | - | Process_Complete_BPMN.pmx | overwrite | 3 | - | Process_Complete_BPMN.pmx | disable | 4 | - | Process_Complete_BPMN.pmx | keep | 5 | + | project_file | import_option | prj_uid_number | + | Process_NewCreate_BPMN.pmx | create | 1 | + | Process_Complete_BPMN.pmx | create | 2 | + | Process_Complete_BPMN.pmx | overwrite | 3 | + | Process_Complete_BPMN.pmx | disable | 4 | + | Process_Complete_BPMN.pmx | keep | 5 | + | Test_Event_without_name.pmx | create | 6 | +#Verificar que se hayan exportado los eventos de forma correcta + +Scenario: Get a single Process process "Test_Event_without_name.pmx" + Given that I want to get a resource with the key "prj_uid" stored in session array as variable "prj_uid_" + 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 "prj_name" is set to "Test Event without name" + And that "evn_uid" is set to "51368855353d127b52c8904071509317" + And that "evn_name" is set to "" + And that "evn_uid" is set to "89601044553d127b52634d4017150624" + And that "evn_name" is set to "" + And that "flo_element_origin" is set to "89601044553d127b52634d4017150624" + + + + + + + + + + + + #Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. diff --git a/features/backend/projects/step/main_tests_step.feature b/features/backend/projects/step/main_tests_step.feature index 22a4ce787..4f5ed6c1e 100644 --- a/features/backend/projects/step/main_tests_step.feature +++ b/features/backend/projects/step/main_tests_step.feature @@ -68,31 +68,19 @@ Feature: Project Properties - Step Resources Main Tests And the response status message should have the following text "exists" - Scenario Outline: Try delete a Input Document when it is assigned to a step - Given that I want to delete a resource with the key "step_uid" stored in session array as variable "step_uid_" - And I request "project/16062437052cd6141881e06088349078/input-document" - And the content type is "application/json" + Scenario: Try delete a Input Document when it is assigned to a step + Given that I want to delete a "InputDocument" + And I request "project/16062437052cd6141881e06088349078/input-document/83199959452cd62589576c1018679557" Then the response status code should be 400 And the response status message should have the following text "assigned" - Examples: - | step_number | - | 2 | - - - Scenario Outline: Try delete a Output document when it is assigned to a step - Given that I want to delete a resource with the key "step_uid" stored in session array as variable "step_uid_" - And I request "project/16062437052cd6141881e06088349078/output-document" - And the content type is "application/json" + Scenario: Try delete a Output document when it is assigned to a step + Given that I want to delete a "OutputDocument" + And I request "project/16062437052cd6141881e06088349078/output-document/32743823452cd63105006e1076595203" Then the response status code should be 400 And the response status message should have the following text "assigned" - Examples: - - | step_number | - | 3 | - Scenario Outline: Update the five steps and then check if the values had changed diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 69eb22afd..1edb13fce 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1629,8 +1629,56 @@ class RestContext extends BehatContext } if (!$swFound) { //print_r($this->_data); - throw new \Exception("JSON Response does not have '$varName' property\n\n" ); + $this->printDebug("JSON Response does not have '$sessionVarName' property\n\n"); + //throw new \Exception("JSON Response does not have '$sessionVarName' property\n\n" ); } + } + + /** + * @Given /^that "([^"]*)" property in object "([^"]*)" equals "([^"]*)"$/ + */ + public function thatPropertyInObjectEquals($propertyName, $propertyParent, $value) + { + $data = $this->_data; + if (empty($data)) { + throw new Exception("Response is empty or was not JSON\n\n" + . $this->_response->getBody(true)); + return; + } + + if (!isset($data->$propertyParent)) { + throw new Exception("Response has not the property '$propertyParent'\n\n" + . $this->_response->getBody(true)); + return; + } + + $data = $data->$propertyParent; + + if (!empty($data)) { + if (!is_object($data)) { + throw new Exception("the $propertyParent in Response data is not an object!\n\n" ); + } + if (!isset($data->$propertyName)) { + throw new Exception("Property '" + . $propertyName . "' is not set!\n\n" + ); + } + if (is_array($data->$propertyName)) { + throw new Exception("$propertyName is an array and we expected a value\n\n" + . $this->_response->getBody(true)); + } + if ($data->$propertyName != $propertyValue) { + throw new \Exception('Property value mismatch! (given: ' + . $propertyValue . ', match: ' + . $data->$propertyName . ")\n\n" + ); + } + } else { + throw new Exception("Response was not JSON\n\n" + . $this->_response->getBody(true)); + } + + } /** * @Given /^save exported process to "([^"]*)"$/