diff --git a/features/backend/case_tracker/case_tracket.feature b/features/backend/case_tracker/basic_sequence.feature similarity index 100% rename from features/backend/case_tracker/case_tracket.feature rename to features/backend/case_tracker/basic_sequence.feature diff --git a/features/backend/input_documents_resources/basic_sequence.feature b/features/backend/input_documents_resources/basic_sequence.feature new file mode 100644 index 000000000..086df5755 --- /dev/null +++ b/features/backend/input_documents_resources/basic_sequence.feature @@ -0,0 +1,134 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Input Documents Resources + Background: + Given that I have a valid access_token + + #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents + # Get a List Input Documents of a Project + Scenario: Get a List Input Documents of a Project + And I request "project/14414793652a5d718b65590036026581/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 json data is an empty array + + #POST /api/1.0/{workspace}/project/{prj_uid}/input-document + # Create a new Input Document for a Project + Scenario: Create "My InputDocument1" for a Project + And POST this data: + """ + { + "inp_doc_title": "My InputDocument1", + "inp_doc_description": "My InputDocument1 DESCRIPTION", + "inp_doc_form_needed": "VIRTUAL", + "inp_doc_original": "ORIGINAL", + "inp_doc_published": "PRIVATE", + "inp_doc_versioning": 1, + "inp_doc_destination_path": "", + "inp_doc_tags": "INPUT" + } + """ + And I request "project/14414793652a5d718b65590036026581/input-document" + 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 "inp_doc_uid" in session array as variable "inp_doc_uid1" + + #POST /api/1.0/{workspace}/project/{prj_uid}/input-document + # Create a new Input Document for a Project + Scenario: Create "My InputDocument2" for a Project + And POST this data: + """ + { + "inp_doc_title": "My InputDocument2", + "inp_doc_description": "My InputDocument2 DESCRIPTION", + "inp_doc_form_needed": "VIRTUAL", + "inp_doc_original": "ORIGINAL", + "inp_doc_published": "PRIVATE", + "inp_doc_versioning": 1, + "inp_doc_destination_path": "", + "inp_doc_tags": "INPUT" + } + """ + And I request "project/14414793652a5d718b65590036026581/input-document" + 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 "inp_doc_uid" in session array as variable "inp_doc_uid2" + + #PUT /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} + # Update an Input Document for a Project + Scenario: Update an Input Document for a Project + And PUT this data: + """ + { + "inp_doc_title": "My InputDocument1 Modified", + "inp_doc_description": "My InputDocument1 DESCRIPTION Modified", + "inp_doc_form_needed": "VIRTUAL", + "inp_doc_original": "ORIGINAL", + "inp_doc_published": "PRIVATE" + } + """ + And that I want to update a resource with the key "inp_doc_uid1" stored in session array + And I request "project/14414793652a5d718b65590036026581/input-document" + 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" + + #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents + # Get a List Input Documents of a Project + Scenario: Get a List Input Documents of a Project + And I request "project/14414793652a5d718b65590036026581/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 "inp_doc_title" property in row 0 equals "My InputDocument1 Modified" + And the "inp_doc_description" property in row 0 equals "My InputDocument1 DESCRIPTION Modified" + + #GET /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} + # Get a single Input Document of a Project + Scenario: Get a single Input Document of a Project + And that I want to get a resource with the key "inp_doc_uid1" stored in session array + And I request "project/14414793652a5d718b65590036026581/input-document" + 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 "inp_doc_title" is set to "My InputDocument1 Modified" + And that "inp_doc_description" is set to "My InputDocument1 DESCRIPTION Modified" + + #DELETE /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} + # Delete an Input Document of a Project + Scenario: Delete a previously created Input Document + And that I want to delete a resource with the key "inp_doc_uid1" stored in session array + And I request "project/14414793652a5d718b65590036026581/input-document" + 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" + + #DELETE /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} + # Delete an Input Document of a Project + Scenario: Delete a previously created Input Document + And that I want to delete a resource with the key "inp_doc_uid2" stored in session array + And I request "project/14414793652a5d718b65590036026581/input-document" + 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" + + #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents + # Get a List Input Documents of a Project + Scenario: Get a List Input Documents of a Project + And I request "project/14414793652a5d718b65590036026581/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 json data is an empty array + diff --git a/features/backend/input_documents_resources/input_document.feature b/features/backend/input_documents_resources/input_document.feature deleted file mode 100644 index d9e7a6083..000000000 --- a/features/backend/input_documents_resources/input_document.feature +++ /dev/null @@ -1,214 +0,0 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Input Documents Resources - - Background: - Given that I have a valid access_token - - #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents - # Get a List Input Documents of a Project - Scenario: Get a List Input Documents of a Project - And I request "project/14414793652a5d718b65590036026581/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 0 records - - - #POST /api/1.0/{workspace}/project/{prj_uid}/input-document - #Create a new Input Document for a Project - Scenario Outline: Create a new Inputs Documents for a Project - Given POST this data: - """ - { - "inp_doc_title": "", - "inp_doc_description": "", - "inp_doc_form_needed": "", - "inp_doc_original": "", - "inp_doc_published": "", - "inp_doc_versioning": "", - "inp_doc_destination_path": "", - "inp_doc_tags": "" - } - """ - And I request "project//input-document" - Then the response status code should be 201 - And the content type is "application/json" - And the response charset is "UTF-8" - And the type is "object" - And store "inp_doc_uid" in session array as variable "inp_doc_uid_" - - Examples: - - | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | - | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 | My InputDocument1 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 | My InputDocument3 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 4 | My InputDocument4 | My InputDocument4 DESCRIPTION | VREAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 5 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COPY | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 6 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT | - | 14414793652a5d718b65590036026581 | 7 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my/path | INPUT | - | 14414793652a5d718b65590036026581 | 8 | My InputDocument8 | My InputDocument8 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 9 | My InputDocument9 | My InputDocument9 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 10 | My InputDocument10 !@#$%^&*€¤½¼‘¾¡²¤³ | My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 11 | My InputDocument11 | My InputDocument11 !@#$%^&*€¤½¼‘¾¡²¤³| REAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 12 | My InputDocument12 | My InputDocument12 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my#@$#%/path324@$@@ | INPUT | - | 14414793652a5d718b65590036026581 | 13 | My InputDocument13 | My InputDocument13 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPU455 @##$$³¤¤ | - - - - - #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents - # Get a List Input Documents of a Project - Scenario: Get a List Input Documents of a Project - And I request "project/14414793652a5d718b65590036026581/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 13 records - - - - #PUT /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} - # Update an Input Document for a Project - Scenario Outline: Update an Input Document for a Project - Given PUT this data: - """ - { - "inp_doc_title": "", - "inp_doc_description": "", - "inp_doc_form_needed": "", - "inp_doc_original": "", - "inp_doc_published": "", - "inp_doc_versioning": "", - "inp_doc_destination_path": "", - "inp_doc_tags": "" - } - """ - And that I want to update a resource with the key "inp_doc_uid" stored in session array as variable "inp_doc_uid_" - And I request "project//input-document" - 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 | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | - | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 'UPDATE' | My InputDocument1 DESCRIPTION-update| VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 'UPDATE' | My InputDocument2 DESCRIPTION-update| VREAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 'UPDATE' | My InputDocument3 DESCRIPTION-update| REAL | ORIGINAL | PRIVATE | 1 | | INPUT | - - - - Scenario Outline: Get a input Document - - Given that I want to get a resource with the key "inp_doc_uid" stored in session array as variable "inp_doc_uid_" - And I request "project//input-document" - 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 "inp_doc_title" is set to "" - And that "inp_doc_description" is set to "" - And that "inp_doc_form_needed" is set to "" - - Examples: - - | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | - | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 'UPDATE' | My InputDocument1 DESCRIPTION-update| VIRTUAL | - | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 'UPDATE' | My InputDocument2 DESCRIPTION-update| VREAL | - | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 'UPDATE' | My InputDocument3 DESCRIPTION-update| REAL | - - - #GET /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} - # Get a single Input Document of a Project - Scenario: Get a single Input Document of a Project - Given that I want to get a resource with the key "inp_doc_uid_1" stored in session array - And I request "project/14414793652a5d718b65590036026581/input-document" - 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 "inp_doc_title" is set to "My InputDocument1 Modified" - And that "inp_doc_description" is set to "My InputDocument1 DESCRIPTION Modified" - - - - #DELETE /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid} - # Delete an Input Document of a Project - Scenario Outline: Delete a previously created Input Document - Given that I want to delete a resource with the key "inp_out_uid" stored in session array as variable "inp_doc_uid_" - And I request "project//input-document" - 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 | inp_doc_number | - | 14414793652a5d718b65590036026581 | 1 | - | 14414793652a5d718b65590036026581 | 2 | - | 14414793652a5d718b65590036026581 | 3 | - | 14414793652a5d718b65590036026581 | 4 | - | 14414793652a5d718b65590036026581 | 5 | - | 14414793652a5d718b65590036026581 | 6 | - | 14414793652a5d718b65590036026581 | 7 | - | 14414793652a5d718b65590036026581 | 8 | - | 14414793652a5d718b65590036026581 | 9 | - | 14414793652a5d718b65590036026581 | 10 | - | 14414793652a5d718b65590036026581 | 11 | - | 14414793652a5d718b65590036026581 | 12 | - | 14414793652a5d718b65590036026581 | 13 | - - - - #GET /api/1.0/{workspace}/project/{prj_uid}/input-documents - # Get a List Input Documents of a Project - Scenario: Get a List Input Documents of a Project - And I request "project/14414793652a5d718b65590036026581/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 0 records - - - - - #POST /api/1.0/{workspace}/project/{prj_uid}/input-document - #Create a new Input Document for a Project - Scenario Outline: Create a new Inputs Documents for a Project - Given POST this data: - """ - { - "inp_doc_title": "", - "inp_doc_description": "", - "inp_doc_form_needed": "", - "inp_doc_original": "", - "inp_doc_published": "", - "inp_doc_versioning": "", - "inp_doc_destination_path": "", - "inp_doc_tags": "" - } - """ - And I request "project//input-document" - Then the response status code should be 400 - - - Examples: - - | project | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | - | 14414793652a5d718b65590036 | My InputDocument1 | My InputDocument1 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument4 | My InputDocument4 DESCRIPTION | VRESAMPLE12334$%#@ | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COORIGI 123@#$%$% | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIV123234@##$$%% | 0 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 87 | | INPUT | - | | My InputDocument10 | My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument11 | My InputDocument11 DESCRIPTION | | ORIGINAL | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument12 | My InputDocument12 DESCRIPTION | REAL | | PRIVATE | 1 | | INPUT | - | 14414793652a5d718b65590036026581 | My InputDocument13 | My InputDocument13 DESCRIPTION | VREAL | ORIGINAL | | 1 | | INPUT | - diff --git a/features/backend/input_documents_resources/main_tests.feature b/features/backend/input_documents_resources/main_tests.feature new file mode 100644 index 000000000..cb0c59fee --- /dev/null +++ b/features/backend/input_documents_resources/main_tests.feature @@ -0,0 +1,159 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Input Documents Main Tests + Requirements: + a workspace with the process 14414793652a5d718b65590036026581 already loaded + the process name is "Sample Project #1" + there are zero input documents in the process + + + Background: + Given that I have a valid access_token + + + Scenario: Get the Input Documents List when there are exactly zero input documents + Given I request "project/14414793652a5d718b65590036026581/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 0 records + + + Scenario Outline: Create 13 new Input Documents + Given POST this data: + """ + { + "inp_doc_title": "", + "inp_doc_description": "", + "inp_doc_form_needed": "", + "inp_doc_original": "", + "inp_doc_published": "", + "inp_doc_versioning": "", + "inp_doc_destination_path": "", + "inp_doc_tags": "" + } + """ + And I request "project//input-document" + Then the response status code should be 201 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + And store "inp_doc_uid" in session array as variable "inp_doc_uid_" + + Examples: + + | test_description | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | + | Create with virtual with versioning | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Create with virtual without versioning | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT | + | Create with real with versioning | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 | My InputDocument3 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Create with vreal with versioning | 14414793652a5d718b65590036026581 | 4 | My InputDocument4 | My InputDocument4 DESCRIPTION | VREAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Create with virtual, copy and versioning | 14414793652a5d718b65590036026581 | 5 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COPY | PRIVATE | 1 | | INPUT | + | Create with virtual, original and without versioning | 14414793652a5d718b65590036026581 | 6 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT | + | Create with virtual, versioning and destination path | 14414793652a5d718b65590036026581 | 7 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my/path | INPUT | + | Create with virtual, without versioning and destination path | 14414793652a5d718b65590036026581 | 8 | My InputDocument8 | My InputDocument8 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT | + | Create with real, without versioning and destination path | 14414793652a5d718b65590036026581 | 9 | My InputDocument9 | My InputDocument9 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT | + | Create with special characters in inp doc title | 14414793652a5d718b65590036026581 | 10 | My InputDocument10 !@#$%^&*€¤½¼‘¾¡²¤³| My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Create with special characters in inp doc description | 14414793652a5d718b65590036026581 | 11 | My InputDocument11 | My InputDocument11 !@#$%^&*€¤½¼‘¾¡²¤³| REAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Create with special characters in inp doc destination path | 14414793652a5d718b65590036026581 | 12 | My InputDocument12 | My InputDocument12 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my#@$#%/path324@$@@ | INPUT | + | Create with special characters in inp doc tags | 14414793652a5d718b65590036026581 | 13 | My InputDocument13 | My InputDocument13 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPU455 @##$$³¤¤ | + + + + + Scenario: Get the Input Documents list when there are 13 records + Given I request "project/14414793652a5d718b65590036026581/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 13 records + + + + Scenario Outline: Update the Input Documents and then check if the values had changed + Given PUT this data: + """ + { + "inp_doc_title": "", + "inp_doc_description": "", + "inp_doc_form_needed": "", + "inp_doc_original": "", + "inp_doc_published": "", + "inp_doc_versioning": "", + "inp_doc_destination_path": "", + "inp_doc_tags": "" + } + """ + And that I want to update a resource with the key "inp_doc_uid" stored in session array as variable "inp_doc_uid_" + And I request "project//input-document" + 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: + + | test_description | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | + | Update inp doc title and inp doc description | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 'UPDATE' | My InputDocument1 DESCRIPTION-update| VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Update inp doc title, inp doc description and inp doc form needed | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 'UPDATE' | My InputDocument2 DESCRIPTION-update| VREAL | ORIGINAL | PRIVATE | 1 | | INPUT | + | Update inp doc title, inp doc description and inp doc versioning | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 'UPDATE' | My InputDocument3 DESCRIPTION-update| REAL | ORIGINAL | PRIVATE | 0 | | INPUT | + + + + Scenario Outline: Get a single Input Document to verify that the were updated correctly in previous step + Given that I want to get a resource with the key "inp_doc_uid" stored in session array as variable "inp_doc_uid_" + And I request "project//input-document" + 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 "inp_doc_title" is set to "" + And that "inp_doc_description" is set to "" + And that "inp_doc_form_needed" is set to "" + And that "inp_doc_versioning" is set to "" + + Examples: + + | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_versioning | + | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 'UPDATE' | My InputDocument1 DESCRIPTION-update| VIRTUAL | 1 | + | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 'UPDATE' | My InputDocument2 DESCRIPTION-update| VREAL | 1 | + | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 'UPDATE' | My InputDocument3 DESCRIPTION-update| REAL | 0 | + + + + + Scenario Outline: Delete all Input documents created previously in this script + Given that I want to delete a resource with the key "inp_out_uid" stored in session array as variable "inp_doc_uid_" + And I request "project//input-document" + 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 | inp_doc_number | + | 14414793652a5d718b65590036026581 | 1 | + | 14414793652a5d718b65590036026581 | 2 | + | 14414793652a5d718b65590036026581 | 3 | + | 14414793652a5d718b65590036026581 | 4 | + | 14414793652a5d718b65590036026581 | 5 | + | 14414793652a5d718b65590036026581 | 6 | + | 14414793652a5d718b65590036026581 | 7 | + | 14414793652a5d718b65590036026581 | 8 | + | 14414793652a5d718b65590036026581 | 9 | + | 14414793652a5d718b65590036026581 | 10 | + | 14414793652a5d718b65590036026581 | 11 | + | 14414793652a5d718b65590036026581 | 12 | + | 14414793652a5d718b65590036026581 | 13 | + + + + Scenario: Get the Input Documents List when there are exactly zero input documents after of delete all Input documents + Given I request "project/14414793652a5d718b65590036026581/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 0 records diff --git a/features/backend/input_documents_resources/negative_tests.feature b/features/backend/input_documents_resources/negative_tests.feature new file mode 100644 index 000000000..d2dfe485b --- /dev/null +++ b/features/backend/input_documents_resources/negative_tests.feature @@ -0,0 +1,39 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Output Documents Negative Tests + + + Background: + Given that I have a valid access_token + + Scenario Outline: Create a new input document for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "inp_doc_title": "", + "inp_doc_description": "", + "inp_doc_form_needed": "", + "inp_doc_original": "", + "inp_doc_published": "", + "inp_doc_versioning": "", + "inp_doc_destination_path": "", + "inp_doc_tags": "" + } + """ + And I request "project//input-document" + Then the response status code should be + And the response status message should have the following text "" + + + Examples: + + | test_description | project | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags | error_code | error_message | + | Create with project invalid | 14414793652a5d718b65590036 | My InputDocument1 | My InputDocument1 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | 400 | project | + | Invalid inp doc from needed | 14414793652a5d718b65590036026581 | My InputDocument4 | My InputDocument4 DESCRIPTION | VRESAMPLE12334$%#@ | ORIGINAL | PRIVATE | 1 | | INPUT | 400 | inp_doc_form_needed | + | Invalid inp doc original | 14414793652a5d718b65590036026581 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COORIGI 123@#$%$% | PRIVATE | 1 | | INPUT | 400 | inp_doc_original | + | Invalid inp doc published | 14414793652a5d718b65590036026581 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIV123234@##$$%% | 0 | | INPUT | 400 | inp_doc_published | + | Invalid inp doc versioning | 14414793652a5d718b65590036026581 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 87 | | INPUT | 400 | inp_doc_versioning | + | Create without id of project | | My InputDocument10 | My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | 400 | project | + | Create without inp doc form needed | 14414793652a5d718b65590036026581 | My InputDocument11 | My InputDocument11 DESCRIPTION | | ORIGINAL | PRIVATE | 1 | | INPUT | 400 | inp_doc_form_needed | + | Create without inp doc original | 14414793652a5d718b65590036026581 | My InputDocument12 | My InputDocument12 DESCRIPTION | REAL | | PRIVATE | 1 | | INPUT | 400 | inp_doc_original | + | Create without inp doc published | 14414793652a5d718b65590036026581 | My InputDocument13 | My InputDocument13 DESCRIPTION | VREAL | ORIGINAL | | 1 | | INPUT | 400 | inp_doc_published | + | Create without inp doc title | 14414793652a5d718b65590036026581 | | My InputDocument1 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT | 400 | inp_doc_title | \ No newline at end of file diff --git a/features/backend/output_documents_resources/main_tests.feature b/features/backend/output_documents_resources/main_tests.feature index b14ebc4b0..ad3e67c0f 100644 --- a/features/backend/output_documents_resources/main_tests.feature +++ b/features/backend/output_documents_resources/main_tests.feature @@ -70,24 +70,24 @@ Feature: Output Documents Main Tests Examples: - | project | out_doc_number | out_doc_title | out_doc_description |out_doc_filename | out_doc_template | out_doc_report_generator | out_doc_landscape | out_doc_media | out_doc_left_margin | out_doc_right_margin | out_doc_top_margin | out_doc_bottom_margin | out_doc_generate | out_doc_type | out_doc_current_revision | out_doc_field_mapping | out_doc_versioning | out_doc_destination_path | out_doc_tags | out_doc_pdf_security_enabled | out_doc_pdf_security_open_password | out_doc_pdf_security_owner_password | out_doc_pdf_security_permissions | - | 4224292655297723eb98691001100052 | 1 | Endpoint Old Version | Output Document old version - EndPoint | Output 1 | | HTML2PDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version PDF SECURITY | Output Document old version PDF SECURITY | Output 2 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | - | 4224292655297723eb98691001100052 | 3 | Endpoint Old Version Doc | Output Document old version solo doc | Output 3 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 4 | Endpoint Old Version PDF | Output Document old version solo pdf | Output 4 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | - | 4224292655297723eb98691001100052 | 5 | Endpoint New Version | Output Document new version - EndPoint | Output 5 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 6 | Endpoint New Version PDF SECURITY | Output Document new version PDF SECURITY | Output 6 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | - | 4224292655297723eb98691001100052 | 7 | Endpoint New Version Doc | Output Document new version solo doc | Output 7 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 8 | Endpoint New Version PDF | Output Document new version solo pdf | Output 8 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | - | 4224292655297723eb98691001100052 | 9 | test !@#$%^&*€¤¾½²³€¼½¼ | Output Document old version - EndPoint | Output 9 | | HTML2PDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 10 | Endpoint Old1 | test %^&*€¤¾½²³€ | Output 10 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | - | 4224292655297723eb98691001100052 | 11 | Endpoint Old Version Doc 2 | Output Document old version solo doc | Output @#$%^&*€¤ | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 12 | Endpoint Old Version PDF 3 | Output Document old version solo pdf | Output 11 | sample @#$%^&*€¤ | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | - | 4224292655297723eb98691001100052 | 13 | Endpoint New Version Doc 14 | Output Document new version solo doc | Output 12 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | 324#$%%^^@@ | 1 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 14 | Endpoint New Version 16 | Output Document new version - EndPoint | Output 13 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | 23rg@#$% | | 0 | | | | - | 4224292655297723eb98691001100052 | 15 | Endpoint New Version PDF SECURI17 | Output Document new version PDF SECURITY | Output 14 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | vfv23@$@% | 1 | sample | sample | print\|modify\|copy\|forms | - | 4224292655297723eb98691001100052 | 16 | Endpoint New Version PDF 19 | Output Document new version solo pdf | Output 15 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample432@$#@$¼€¼½ | sample | print | - | 4224292655297723eb98691001100052 | 17 | Endpoint New Version 20 | Output Document new version - EndPoint | Output 16 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | sample432@$#@$¼€¼½ | | + | test_description | project | out_doc_number | out_doc_title | out_doc_description |out_doc_filename | out_doc_template | out_doc_report_generator | out_doc_landscape | out_doc_media | out_doc_left_margin | out_doc_right_margin | out_doc_top_margin | out_doc_bottom_margin | out_doc_generate | out_doc_type | out_doc_current_revision | out_doc_field_mapping | out_doc_versioning | out_doc_destination_path | out_doc_tags | out_doc_pdf_security_enabled | out_doc_pdf_security_open_password | out_doc_pdf_security_owner_password | out_doc_pdf_security_permissions | + | Create with old version and both | 4224292655297723eb98691001100052 | 1 | Endpoint Old Version | Output Document old version - EndPoint | Output 1 | | HTML2PDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | + | Craate with old version and pdf security | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version PDF SECURITY | Output Document old version PDF SECURITY | Output 2 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | + | Create with old version only doc | 4224292655297723eb98691001100052 | 3 | Endpoint Old Version Doc | Output Document old version solo doc | Output 3 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | + | Create with old version only pdf | 4224292655297723eb98691001100052 | 4 | Endpoint Old Version PDF | Output Document old version solo pdf | Output 4 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | + | Create with new version and both | 4224292655297723eb98691001100052 | 5 | Endpoint New Version | Output Document new version - EndPoint | Output 5 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | + | Create with new version and pdf security | 4224292655297723eb98691001100052 | 6 | Endpoint New Version PDF SECURITY | Output Document new version PDF SECURITY | Output 6 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | + | Create with new version only doc | 4224292655297723eb98691001100052 | 7 | Endpoint New Version Doc | Output Document new version solo doc | Output 7 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | + | Create with new version only pdf | 4224292655297723eb98691001100052 | 8 | Endpoint New Version PDF | Output Document new version solo pdf | Output 8 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | + | Create with special characters in out doc title | 4224292655297723eb98691001100052 | 9 | test !@#$%^&*€¤¾½²³€¼½¼ | Output Document old version - EndPoint | Output 9 | | HTML2PDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | + | Create with special characters in out doc description | 4224292655297723eb98691001100052 | 10 | Endpoint Old1 | test %^&*€¤¾½²³€ | Output 10 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | + | Create with special characters in out doc filename | 4224292655297723eb98691001100052 | 11 | Endpoint Old Version Doc 2 | Output Document old version solo doc | Output @#$%^&*€¤ | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | | 1 | | | 0 | | | | + | Create with special characters in out doc template | 4224292655297723eb98691001100052 | 12 | Endpoint Old Version PDF 3 | Output Document old version solo pdf | Output 11 | sample @#$%^&*€¤ | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | + | Create with special characters in out doc field mapping | 4224292655297723eb98691001100052 | 13 | Endpoint New Version Doc 14 | Output Document new version solo doc | Output 12 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | DOC | HTML | 0 | 324#$%%^^@@ | 1 | | | 0 | | | | + | Create with special characters in out doc destination path | 4224292655297723eb98691001100052 | 14 | Endpoint New Version 16 | Output Document new version - EndPoint | Output 13 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | 23rg@#$% | | 0 | | | | + | Create with special characters in out doc tags | 4224292655297723eb98691001100052 | 15 | Endpoint New Version PDF SECURI17 | Output Document new version PDF SECURITY | Output 14 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | vfv23@$@% | 1 | sample | sample | print\|modify\|copy\|forms | + | Create with special characters in out doc pdf security open password | 4224292655297723eb98691001100052 | 16 | Endpoint New Version PDF 19 | Output Document new version solo pdf | Output 15 | | TCPDF | 0 | Legal | 25 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample432@$#@$¼€¼½ | sample | print | + | Create with special characters in out doc pdf security owner password | 4224292655297723eb98691001100052 | 17 | Endpoint New Version 20 | Output Document new version - EndPoint | Output 16 | | TCPDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | sample432@$#@$¼€¼½ | | Scenario: Get the Output Documents list when there are 19 records @@ -135,15 +135,14 @@ Feature: Output Documents Main Tests Examples: - | project | out_doc_number | out_doc_title | out_doc_description |out_doc_filename | out_doc_template | out_doc_report_generator | out_doc_landscape | out_doc_media | out_doc_left_margin | out_doc_right_margin | out_doc_top_margin | out_doc_bottom_margin | out_doc_generate | out_doc_type | out_doc_current_revision | out_doc_field_mapping | out_doc_versioning | out_doc_destination_path | out_doc_tags | out_doc_pdf_security_enabled | out_doc_pdf_security_open_password | out_doc_pdf_security_owner_password | out_doc_pdf_security_permissions | - | 4224292655297723eb98691001100052 | 1 | Endpoint Old Version UPDATE | Output Document old version - UPDATE | Output 1 | | HTML2PDF | 0 | Letter | 20 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version PDF SECURITY UPDATE | Output UPDATE old version PDF SECURITY | Output 2 | | HTML2PDF | 1 | Legal | 20 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy | - | 4224292655297723eb98691001100052 | 5 | Endpoint New Version UPDATE | Output UPDATE new version - EndPoint | Output 5 | | TCPDF | 0 | Letter | 30 | 20 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | - | 4224292655297723eb98691001100052 | 6 | Endpoint New Version PDF SECURITY UPDATE | Output UPDATE new version PDF SECURITY | Output 6 | | TCPDF | 1 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy | + | test_description | project | out_doc_number | out_doc_title | out_doc_description |out_doc_filename | out_doc_template | out_doc_report_generator | out_doc_landscape | out_doc_media | out_doc_left_margin | out_doc_right_margin | out_doc_top_margin | out_doc_bottom_margin | out_doc_generate | out_doc_type | out_doc_current_revision | out_doc_field_mapping | out_doc_versioning | out_doc_destination_path | out_doc_tags | out_doc_pdf_security_enabled | out_doc_pdf_security_open_password | out_doc_pdf_security_owner_password | out_doc_pdf_security_permissions | + | Update out doc title and description | 4224292655297723eb98691001100052 | 1 | Endpoint Old Version UPDATE | Output Document old version - UPDATE | Output 1 | | HTML2PDF | 0 | Letter | 20 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | + | Update out doc title and out doc generate | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version PDF SECURITY UPDATE | Output UPDATE old version PDF SECURITY | Output 2 | | TCPDF | 1 | Legal | 20 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy | + | Update out doc title and description | 4224292655297723eb98691001100052 | 5 | Endpoint New Version UPDATE | Output UPDATE new version - EndPoint | Output 5 | | TCPDF | 0 | Letter | 30 | 20 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | + | Update out doc title and out doc generate | 4224292655297723eb98691001100052 | 6 | Endpoint New Version PDF SECURITY UPDATE | Output UPDATE new version PDF SECURITY | Output 6 | | HTML2PDF | 1 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy | Scenario Outline: Get a single Output Document and check some properties - Given that I want to get a resource with the key "out_doc_uid" stored in session array as variable "out_doc_uid_" And I request "project//output-document" And the content type is "application/json" diff --git a/features/backend/output_documents_resources/negative_tests.feature b/features/backend/output_documents_resources/negative_tests.feature index d17644968..cbcde68f3 100644 --- a/features/backend/output_documents_resources/negative_tests.feature +++ b/features/backend/output_documents_resources/negative_tests.feature @@ -41,7 +41,11 @@ Feature: Output Documents Negative Tests Examples: | test_description | project | out_doc_title | out_doc_description |out_doc_filename | out_doc_template | out_doc_report_generator | out_doc_landscape | out_doc_media | out_doc_left_margin | out_doc_right_margin | out_doc_top_margin | out_doc_bottom_margin | out_doc_generate | out_doc_type | out_doc_current_revision | out_doc_field_mapping | out_doc_versioning | out_doc_destination_path | out_doc_tags | out_doc_pdf_security_enabled | out_doc_pdf_security_open_password | out_doc_pdf_security_owner_password | out_doc_pdf_security_permissions | error_code | error_message | +<<<<<<< HEAD | Invalid PDF Generator | 4224292655297723eb98691001100052 | Endpoint New Version 4 | Output Document new version - EndPoint | Output 5 | | @#$%¼¤¾½ | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | 400 | out_doc_report_generator | +======= + | Invalid PDF Generator | 4224292655297723eb98691001100052 | Endpoint New Version 4 | Output Document new version - EndPoint | Output 5 | | @#$%¼¤¾½ | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | 400 | out_doc_report_generator | +>>>>>>> 9b60b95409a2e6c3ee67def7130e123f66523eee | Invalid landscape | 4224292655297723eb98691001100052 | Endpoint New Version PDF SECURIT5 | Output Document new version PDF SECURITY | Output 6 | | TCPDF | 34 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 1 | sample | sample | print\|modify\|copy\|forms | 400 | out_doc_landscape | | Invalid media type | 4224292655297723eb98691001100052 | Endpoint New Version Doc6 | Output Document new version solo doc | Output 7 | | TCPDF | 0 | Legal!@#$$$%^&| 25 | 25 | 25 | 25 | WORD | HTML | 0 | | 1 | | | 0 | | | | 400 | out_doc_media | | Invalid document type | 4224292655297723eb98691001100052 | Endpoint New Version PDF7 | Output Document new version solo pdf | Output 8 | | TCPDF | 0 | Legal | 25,56.98 | 25 | 25 | 25 | PDF | HTML | 0 | | 1 | | | 1 | sample | sample | print | 400 | out_doc_left_margin | @@ -56,4 +60,8 @@ Feature: Output Documents Negative Tests | Field requered out doc title | 4224292655297723eb98691001100052 | | Output Document old version - EndPoint | Output 22 | | HTML2PDF | 1 | Letter | 30 | 30 | 30 | 30 | BOTH | HTML | 0 | | 0 | | | 0 | | | | 400 | out_doc_title | | Field required out doc filename | 4224292655297723eb98691001100052 | Endpoint Old Version Doc | Output Document old version solo doc | | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | WORD | HTML | 0 | | 1 | | | 0 | | | | 400 | out_doc_generate | | Output created with same name | 4224292655297723eb98691001100052 | Endpoint Old Version (base) | Output Document old version solo doc | Output 23 | | HTML2PDF | 0 | Legal | 25 | 25 | 25 | 25 | BOTH | HTML | 0 | | 1 | | | 0 | | | | 400 | Output Document with the same name in this process | +<<<<<<< HEAD +======= + +>>>>>>> 9b60b95409a2e6c3ee67def7130e123f66523eee diff --git a/features/backend/process_supervisor_resources/negative_tests.feature b/features/backend/process_supervisor_resources/negative_tests.feature new file mode 100644 index 000000000..5ba670a83 --- /dev/null +++ b/features/backend/process_supervisor_resources/negative_tests.feature @@ -0,0 +1,63 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Process Supervisor Negative tests + + Background: + Given that I have a valid access_token + + Scenario Outline: Assign a user and a group to a process supervisor for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "pu_type": "", + "usr_uid": "" + } + """ + And I request "project//process-supervisor" + Then the response status code should be + And the response status message should have the following text "" + + Examples: + | test_description | project | pu_type | usr_uid | error_code | error_message | + | Invalid pu_type | 85794888452ceeef3675164057928956 | GROUP_USER_DEPARTAMENT | 46138556052cda43a051110007756836 | 400 | pu_type | + | Invalid usr_uid | 85794888452ceeef3675164057928956 | SUPERVISOR | 0000000000000gtr@#$0000000000001 | 400 | usr_uid | + | Field requered project | | SUPERVISOR | 00000000000000000000000000000001 | 400 | project | + | Field requered pu_type | 85794888452ceeef3675164057928956 | | 00000000000000000000000000000001 | 400 | pu_type | + | Field requered urs_uid | 85794888452ceeef3675164057928956 | SUPERVISOR | | 400 | usr_uid | + + + Scenario Outline: Assign a dynaform to a process supervisor for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "dyn_uid": "" + } + """ + And I request "project//process-supervisor/dynaform" + Then the response status code should be + And the response status message should have the following text "" + + + Examples: + | test_description | project | dyn_uid | error_code | error_message | + | Invalid dyn_uid | 85794888452ceeef3675164057928956 | 2ceeef36751640grgrtgrg#$%#%# | 400 | dyn_uid | + | Field requered project | | 78212661352ceef2dc4e987081647602 | 400 | project | + | Field requered dyn_uid | 85794888452ceeef3675164057928956 | 78212661352ceef2dc4e987081647602 | 400 | dyn_uid | + + + Scenario Outline: Assign a Input Document to a process supervisor for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "dyn_uid": "" + } + """ + And I request "project//process-supervisor/input-document" + Then the response status code should be + And the response status message should have the following text "" + + + Examples: + | test_description | project | inp_doc_uid | error_code | error_message | + | Invalid inp_doc_uid | 85794888452ceeef3675164057928956 | 25205290452ceef5@#$41c3067266323 | 400 | inp_doc_uid | + | Field requered project | | 25205290452ceef570741c3067266323 | 400 | project | + | Field requered inp_doc_uid | 85794888452ceeef3675164057928956 | | 400 | inp_doc_uid | \ No newline at end of file diff --git a/features/backend/process_supervisor_resources/process_supervisor.feature b/features/backend/process_supervisor_resources/process_supervisor.feature index ffe266213..f8fe1c893 100644 --- a/features/backend/process_supervisor_resources/process_supervisor.feature +++ b/features/backend/process_supervisor_resources/process_supervisor.feature @@ -2,133 +2,155 @@ Feature: Process supervisor Resources Background: - Given that I have a valid access_token + Given that I have a valid access_token - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisors - @1: TEST FOR GET PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/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 Outline: Get a List of current process supervisors of a project + Given I request "project//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 records + + Examples: + | test_description | project | records | + | List current unique process supervisor | 85794888452ceeef3675164057928956 | 0 | - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/{pu_uid} - @2: TEST FOR GET A SPECIFIC PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a specific process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/70662784652cef0878516f7085532841" - 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" + Scenario Outline: Get a specific process supervisor details of a project + Given I request "project//process-supervisor/" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + + Examples: + | test_description | project | pu_uid | + | Get the supervisor details | 85794888452ceeef3675164057928956 | 70662784652cef0878516f7085532841 | - #GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors - @3: TEST FOR GET USERS AND GROUP SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of available process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/available-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 86 records + Scenario Outline: Get a List of available process supervisor of a project + Given I request "project//available-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 records + + Examples: + | test_description | project | records | + | List users and groups available to be supervisors | 85794888452ceeef3675164057928956 | 24 | - #GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors - @4: TEST FOR GET GROUP SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of available groups process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/available-process-supervisors?obj_type=group" - 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 23 records + Scenario Outline: Get a List of available groups process supervisor of a project + Given I request "project//available-process-supervisors?obj_type=group" + 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: + | test_description | project | records | + | List the 23 groups available to be supervisors | 85794888452ceeef3675164057928956 | 23 | - #GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors - @5: TEST FOR GET USERS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of available users process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/available-process-supervisors?obj_type=user" - 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 63 records + Scenario Outline: Get a List of available users elegible as process supervisor + Given I request "project//available-process-supervisors?obj_type=user" + 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: + | test_description | project | records | + | List the unique admin user available to be supervisor | 85794888452ceeef3675164057928956 | 1 | - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaforms - @6: TEST FOR DYNAFORM PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of dynaforms process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaforms" - 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 a List of dynaforms assigned to a process supervisor + Given I request "project//process-supervisor/dynaforms" + 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: + | test_description | project | records | + | List the 2 pre-assigned dynaforms | 85794888452ceeef3675164057928956 | 2 | - @7: TEST FOR GET A SPECIFIC PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a specific process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform/78069721352ceef1fd61878075214306" + Scenario Outline: Get a specific dynaform detail assigned to a process supervisor + Given I request "project//process-supervisor/dynaform/" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "object" + + Examples: + | test_description | project | pud_uid | + | Get details of the first assigend dynaform | 85794888452ceeef3675164057928956 | 78069721352ceef1fd61878075214306 | + - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/available-dynaforms - @8: TEST FOR GET AVAILABLE DYNAFORM PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of available dynaforms process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/available-dynaforms" + Scenario Outline: Get a List of available dynaforms to be assigned to a process supervisor + Given I request "project//process-supervisor/available-dynaforms" 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 2 records + And the response has records + + Examples: + | test_description | project | records | + | Get a list of available dynaforms to be assigned | 85794888452ceeef3675164057928956 | 1 | - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-documents - @9: TEST FOR GET INPUT DOCUMENT PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of input-documents process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/input-documents" + Scenario Outline: Get a List of assigend input-documents to a process supervisor + Given I request "project//process-supervisor/input-documents" 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: + | test_description | project | records | + | Get a list of pre-assigned input doucments | 85794888452ceeef3675164057928956 | 2 | - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/available-input-documents - @10: TEST FOR GET LIST INPUT DOCUMENTS - PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a List of input-documents process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/available-input-documents" + Scenario Outline: Get a List of available input-documents to be assigned to a process supervisor + Given I request "project//process-supervisor/available-input-documents" 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 2 records + And the response has records + + Examples: + | test_description | project | records | + | Get a list of 1 record of available input documents | 85794888452ceeef3675164057928956 | 1 | - #GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document/{pu_uid} - @11: TEST FOR GET PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Get a specific process supervisor of a project - Given I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document/37709187452ceef4f601dd3045365506" + Scenario Outline: Get a specific input document assigned to a process supervisor + Given I request "project//process-supervisor/input-document/" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "object" + + Examples: + | test_description | project | pui_uid | + | Get details of assigend input document | 85794888452ceeef3675164057928956 | 37709187452ceef4f601dd3045365506 | - #POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor - @12: TEST FOR POST PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario Outline: Assign a user and group process supervisor of a project + Scenario Outline: Assign a user and a group as process supervisors Given POST this data: """ { - "pu_type": "pu_type", - "usr_uid": "usr_uid" + "pu_type": "", + "usr_uid": "" } """ And I request "project//process-supervisor" @@ -136,102 +158,78 @@ Feature: Process supervisor Resources And the response charset is "UTF-8" And the content type is "application/json" And the type is "object" - And store "pu_uid" in session array as variable "pug_uid_" + And store "pu_uid" in session array as variable "pu_uid_" Examples: - | project | ps_number | pu_type | usr_uid | - | 85794888452ceeef3675164057928956 | 1 | GROUP_SUPERVISOR | 46138556052cda43a051110007756836 | - | 85794888452ceeef3675164057928956 | 2 | SUPERVISOR | 00000000000000000000000000000001 | + | test_description | project | pu_number | pu_type | usr_uid | + | Assign a group as Supervisor | 85794888452ceeef3675164057928956 | 1 | GROUP_SUPERVISOR | 54731929352d56741de9d42002704749 | + | Assign a user as Supervisor | 85794888452ceeef3675164057928956 | 2 | SUPERVISOR | 00000000000000000000000000000001 | - #POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaform - @13: TEST FOR POST DYNAFORM PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario Outline: Assign a dynaform process supervisor of a project + Scenario Outline: Assign a dynaform to a process supervisor Given POST this data: """ { - "dyn_uid": "78212661352ceef2dc4e987081647602" + "dyn_uid": "" } """ - And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform" + And I request "project//process-supervisor/dynaform" 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 "pud_uid" in session array as variable "pud_uid_" + And store "pud_uid" in session array as variable "pud_uid_" Examples: - | project | dps_number | dyn_uid | - | 85794888452ceeef3675164057928956 | 1 | 78212661352ceef2dc4e987081647602 | - | 85794888452ceeef3675164057928956 | 1 | | + | test_description | project | pud_number | dyn_uid | + | Assign a dynaform for Supervisor | 85794888452ceeef3675164057928956 | 1 | 27801990352a715de093b64036715425 | - #POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document - @14: TEST FOR POST INPUT DOCUMENT - PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario Outline: Assign a dynaform process supervisor of a project + Scenario Outline: Assign an input document to a process supervisor Given POST this data: """ { "inp_doc_uid": "" } """ - And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document" + And I request "project//process-supervisor/input-document" 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 "pui_uid" in session array as variable "pui_inpdoc_uid_<>" + And store "pui_uid" in session array as variable "pui_inpdoc_uid_" + Examples: - | project | dps_number | inp_doc_uid | - | 85794888452ceeef3675164057928956 | 1 | 25205290452ceef570741c3067266323 | + | test_description | project | dps_number | inp_doc_uid | + | Assign an Input document for Supervisor | 85794888452ceeef3675164057928956 | 1 | 30053187052ddfa4e1fdca4001721051 | - #DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor - @15: TEST FOR DELETE PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario Outline: Delete a user process supervisor of a project - Given that I want to delete a resource with the key "pug_uid" stored in session array - And I request "project/85794888452ceeef3675164057928956/process-supervisor" + Scenario Outline: Delete a process supervisor + Given that I want to delete a resource with the key "pu_uid" stored in session array as variable "pu_uid_" + And I request "project//process-supervisor" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" Examples: - | project | ps_number | - | 85794888452ceeef3675164057928956 | 1 | - | 85794888452ceeef3675164057928956 | 2 | - + | test_description | project | pu_number | + | Remove first assigned supervisor | 85794888452ceeef3675164057928956 | 1 | + | Remove second assigned supervisor | 85794888452ceeef3675164057928956 | 2 | - #DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor - @3: TEST FOR GET PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Delete a user process supervisor of a project - Given that I want to delete a resource with the key "puu_uid" stored in session array - And I request "project/85794888452ceeef3675164057928956/process-supervisor" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - - #DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaform - @3: TEST FOR GET PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Delete a dynaform process supervisor of a project - Given that I want to delete a resource with the key "pud_uid" stored in session array - And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - - #DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document - @3: TEST FOR GET PROCESS SUPERVISOR /-------------------------------------------------------------------- - Scenario: Delete a input-document process supervisor of a project - Given that I want to delete a resource with the key "pui_uid" stored in session array + + Scenario Outline: Delete a input-document process supervisor of a project + Given that I want to delete a resource with the key "pui_uid" stored in session array as variable "pui_inpdoc_uid_" And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document" And the content type is "application/json" 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" + + Examples: + | test_description | project | dps_number | + | Assign an Input document for Supervisor | 85794888452ceeef3675164057928956 | 1 | diff --git a/features/backend/project_activity_resources/activity.feature b/features/backend/project_activity_resources/main_tests.feature similarity index 53% rename from features/backend/project_activity_resources/activity.feature rename to features/backend/project_activity_resources/main_tests.feature index 7fc4b8bec..182d1c643 100644 --- a/features/backend/project_activity_resources/activity.feature +++ b/features/backend/project_activity_resources/main_tests.feature @@ -1,12 +1,17 @@ @ProcessMakerMichelangelo @RestAPI -Feature: Activity Resources +Feature: Activity Resources Main Tests + Requirements: + a workspace with the process 4224292655297723eb98691001100052 already loaded + the process name is "Test Users-Step-Properties End Point" + there are three Activity Resources in the process and one subprocess + Background: Given that I have a valid access_token - @1: TEST FOR GET PROPERTIES & DEFINITION OF A ACTIVITY /----------------------------------------------------------------------- - Scenario Outline: Get an activity - Given I request "project//activity/" + + Scenario Outline: Get the Properties and Definition of a Activity are exactly three activity + Given I request "project//activity/" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" @@ -17,12 +22,13 @@ Feature: Activity Resources Examples: | project | activity | tas_title | - | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | Task 1 | + | 251815090529619a99a2bf4013294414 | 63843886052a5cc066e4c04056414372 | Task 1 | + | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | Task 2 | + | 251815090529619a99a2bf4013294414 | 95655319552a5c790b69a04054667879 | Task 3 | - @2: TEST FOR GET PROPERTIES ACTIVITY /--------------------------------------------------------- - Scenario Outline: Get properties of activity - Given I request "project//activity/?filter=properties" + Scenario Outline: Get the Properties of a Activity are exactly three activity + Given I request "project//activity/?filter=properties" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" @@ -30,14 +36,15 @@ Feature: Activity Resources Examples: - | project | activity | - | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | + | project | activity | tas_title | + | 251815090529619a99a2bf4013294414 | 63843886052a5cc066e4c04056414372 | Task 1 | + | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | Task 2 | + | 251815090529619a99a2bf4013294414 | 95655319552a5c790b69a04054667879 | Task 3 | - @3: TEST FOR GET DEFINITION ACTIVITY /--------------------------------------------------------- - Scenario Outline: Get definition of activity - Given I request "project//activity/?filter=definition" + Scenario Outline: Get the Definition of a Activity are exactly three activity + Given I request "project//activity/?filter=definition" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" @@ -45,47 +52,47 @@ Feature: Activity Resources Examples: - | project | activity | - | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | + | project | activity | tas_title | + | 251815090529619a99a2bf4013294414 | 63843886052a5cc066e4c04056414372 | Task 1 | + | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | Task 2 | + | 251815090529619a99a2bf4013294414 | 95655319552a5c790b69a04054667879 | Task 3 | - @4: TEST FOR PUT DEFINITION ACTIVITY /--------------------------------------------------------- - Scenario Outline: Put property of activity - Given PUT this data: + Scenario Outline: Update the Definition of a Activity and the check if the values had changed + Given PUT this data: """ + { + "definition": {}, + "properties": { - - "definition": {}, - "properties": - { - "tas_title": "", - "tas_description": "", - "tas_priority_variable": "@@VAR_PRIORITY", - "tas_derivation_screen_tpl": "template.html", - "tas_start": , - "tas_assign_type" : "", - "tas_assign_variable": "@@USER_LOGGED", - "tas_group_variable": "@@GROUP_UID", - "tas_selfservice_timeout": "", - "tas_selfservice_time": "", - "tas_selfservice_time_unit" : "", - "tas_selfservice_trigger_uid" : "3229227245298e1c5191f95009451434", - "tas_transfer_fly": , - "tas_duration" : "", - "tas_timeunit" : "", - "tas_type_day": "", - "tas_calendar": "00000000000000000000000000000001", - "tas_type": "", - "tas_def_title": "Case Title", - "tas_def_description": "Case Descripction", - "tas_send_last_email": , - "tas_def_subject_message": "", - "tas_def_message_type": "template", - "tas_def_message": "", - "tas_def_message_template": "template.html" - } + "tas_title": "", + "tas_description": "", + "tas_priority_variable": "", + "tas_derivation_screen_tpl": "", + "tas_start": , + "tas_assign_type" : "", + "tas_assign_variable": "", + "tas_group_variable": "", + "tas_selfservice_timeout": "", + "tas_selfservice_time": "", + "tas_selfservice_time_unit" : "", + "tas_selfservice_trigger_uid" : "", + "tas_transfer_fly": , + "tas_duration" : "", + "tas_timeunit" : "", + "tas_type_day": "", + "tas_calendar": "", + "tas_type": "", + "tas_def_title": "", + "tas_def_description": "", + "tas_send_last_email": , + "tas_def_subject_message": "", + "tas_def_message_type": "", + "tas_def_message": "", + "tas_def_message_template": "" } + } """ And I request "project//activity/" Then the response status code should be 200 @@ -96,8 +103,8 @@ Feature: Activity Resources Examples: - | project | activity | tas_title | tas_description | tas_start | tas_assign_type | tas_selfservice_timeout | tas_selfservice_time | tas_selfservice_time_unit | tas_transfer_fly | tas_duration | tas_timeunit | tas_type_day | tas_type | tas_send_last_email | tas_def_subject_message | tas_def_message | - | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | update activity | update description | true | BALANCED | 0 | 0 | DAYS | true | 4 | DAYS | 1 | NORMAL | true | Email desde tarea | Contenido del email | + | project | activity | tas_title | tas_description | tas_priority_variable | tas_derivation_screen_tpl | tas_start | tas_assign_type | tas_assign_variable| tas_group_variable | tas_selfservice_timeout | tas_selfservice_time | tas_selfservice_time_unit | tas_selfservice_trigger_uid | tas_transfer_fly | tas_duration | tas_timeunit | tas_type_day | tas_calendar | tas_type | tas_def_title | tas_def_description | tas_send_last_email | tas_def_subject_message | tas_def_message_type | tas_def_message | tas_def_message_template | + | 251815090529619a99a2bf4013294414 | 97192372152a5c78f04a794095806311 | update activity | update description | true | BALANCED | 0 | 0 | DAYS | true | 4 | DAYS | 1 | NORMAL | true | Email desde tarea | Contenido del email | | | | | | | | | | | @5: TEST FOR GET ACTIVITY /----------------------------------------------------------------------- diff --git a/features/backend/project_activity_resources/negative_tests.feature b/features/backend/project_activity_resources/negative_tests.feature new file mode 100644 index 000000000..e69de29bb diff --git a/features/backend/project_properties_adhoc_assignee_resources/activity_adhoc_assignee.feature b/features/backend/project_properties_adhoc_assignee_resources/activity_adhoc_assignee.feature index 885a04cc6..d2495a967 100644 --- a/features/backend/project_properties_adhoc_assignee_resources/activity_adhoc_assignee.feature +++ b/features/backend/project_properties_adhoc_assignee_resources/activity_adhoc_assignee.feature @@ -11,46 +11,46 @@ Feature: Project Properties -Adhoc Assignee Resources And the content type is "application/json" And the type is "array" And the response has records - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" + And the "ada_uid" property in row 0 equals "" + And the "ada_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 82 | 35762872152cda4323207c6035916735 | group | + | test_description | project | activity | records | ada_uid | ada_type | + | check if the list of possible users and groups to be assigned is correct | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 84 | 54731929352d56741de9d42002704749 | group | -Scenario Outline: Get a list of available adhoc users and groups to be assigned to an activity with filter + Scenario Outline: Get a list of available adhoc users and groups to be assigned to an activity with filter Given I request "project//activity//adhoc-available-assignee?filter=&start=&limit=" 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 - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" + And the "ada_uid" property in row 0 equals "" + And the "ada_type" property in row 0 equals "" Examples: - | project | activity | filter | start | limit | records | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | departa | 0 | 50 | 3 | 90268877852b7b4b9f134b1096735994 | group | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | departa | 0 | 1 | 1 | 90268877852b7b4b9f134b1096735994 | group | + | test_description | project | activity | filter | start | limit | records | ada_uid | ada_type | + | Using filter get available users that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 50 | 2 | 66623507552d56742865613066097298 | group | + | Using filter get 1 available user that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 1 | 1 | 66623507552d56742865613066097298 | group | Scenario Outline: Assign a adhoc user or group to an activity Given POST this data: -""" -{ - "aas_uid": "", - "aas_type": "" -} -""" + """ + { + "ada_uid": "", + "ada_type": "" + } + """ And I request "project//activity//adhoc-assignee" Then the response status code should be 201 And the type is "object" - Examples: - | project | activity | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 84643774552cda42dabb732033709262 | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 95888918452cda41a2b5d11013819411 | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 16698718252cda431814024050455569 | group | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 90706007452cda42ed1c326093152317 | group | + Examples: + | test_description | project | activity | ada_uid | ada_type | + | assign a user to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | + | assign a user to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 25286582752d56713231082039265791 | user | + | assign a group to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 54731929352d56741de9d42002704749 | group | + | assign a group to the second task | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 | group | @@ -61,13 +61,13 @@ Scenario Outline: Get a list of available adhoc users and groups to be assigned And the content type is "application/json" And the type is "array" And the response has records - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" + And the "ada_uid" property in row 0 equals "" + And the "ada_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 7 | 10732248352cda434c43997043577116 | group | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 5 | 90706007452cda42ed1c326093152317 | group | + | test_description | project | activity | records | ada_uid | ada_type | + | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 5 | 54731929352d56741de9d42002704749 | group | + | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 36775342552d5674146d9c2078497230 | group | Scenario Outline: After assignation - List adhoc assignees of an activity with filter @@ -77,41 +77,41 @@ Scenario Outline: Get a list of available adhoc users and groups to be assigned And the content type is "application/json" And the type is "array" And the response has 1 record - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" + And the "ada_uid" property in row 0 equals "" + And the "ada_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | filter | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 1 | 84643774552cda42dabb732033709262 | user | emi | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 90706007452cda42ed1c326093152317 | group | dep | + | test_description | project | activity | records | ada_uid | ada_type | filter | + | Filtered list should return 1 record | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 1 | 73005191052d56727901138030694610 | user | oli | + | Filtered list should return 1 record | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 36775342552d5674146d9c2078497230 | group | emp | Scenario Outline: Get a single adhoc user or group of an activity - Given I request "project//activity//adhoc-assignee/" + Given I request "project//activity//adhoc-assignee/" 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 the "aas_uid" property equals "" - And the "aas_name" property equals "" - And the "aas_lastname" property equals "" - And the "aas_username" property equals "" - And the "aas_type" property equals "user" + And the "ada_uid" property equals "" + And the "ada_name" property equals "" + And the "ada_lastname" property equals "" + And the "ada_username" property equals "" + And the "ada_type" property equals "user" Examples: - | project | activity | aas_uid | aas_type | aas_name | aas_lastname | aas_username | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 95888918452cda41a2b5d11013819411 | user | Mike | Balisi | mike | + | test_description | project | activity | ada_uid | ada_type | ada_name | ada_lastname | ada_username | + | Obtain details of user assigend to an activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | Olivia | Austin | olivia | Scenario Outline: Remove adhoc assignee from an activity - Given that I want to delete a resource with the key "aas_uid" stored in session array - And I request "project//activity//adhoc-assignee/" + Given that I want to delete a resource with the key "ada_uid" stored in session array + And I request "project//activity//adhoc-assignee/" Then the response status code should be 200 Examples: - | project | activity | aas_uid | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 84643774552cda42dabb732033709262 | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 95888918452cda41a2b5d11013819411 | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 16698718252cda431814024050455569 | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 90706007452cda42ed1c326093152317 | + | test_description | project | activity | ada_uid | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 25286582752d56713231082039265791 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 54731929352d56741de9d42002704749 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 | Scenario: List assignees of an activity Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee" @@ -119,44 +119,8 @@ Scenario Outline: Get a list of available adhoc users and groups to be assigned And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 4 records + And the response has 2 records - Scenario Outline: List assignees of an activity with bad parameters - Given I request "project//activity//adhoc-assignee" - Then the response status code should be 400 - - - Examples: - | project | activity | - | 4224292655297723eb98691001100052 | 1234556 | - | 122134324 | 65496814252977243d57684076211485 | - | 345345345 | 345345345 | - | | | - - -Scenario Outline: Assign a user or group to an activity (Field validation) - Given POST this data: -""" -{ - "ass_uid": "", - "ass_type": "" -} -""" - And I request "project//activity//adhoc-assignee" - Then the response status code should be 400 - And the type is "object" - - # Asignando un user vacio - # Asignando un user inexistente - # Asignando un usuario como grupo - # Asignando un usuario con type inexistente - - Examples: - | project | activity | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | | | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | !@#$%^&*()_+=-[]{};:~, | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 15746307552d00a66624889076110382 | group | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | department | - + \ No newline at end of file diff --git a/features/backend/project_properties_adhoc_assignee_resources/negative_tests.feature b/features/backend/project_properties_adhoc_assignee_resources/negative_tests.feature new file mode 100644 index 000000000..7d0a9c95b --- /dev/null +++ b/features/backend/project_properties_adhoc_assignee_resources/negative_tests.feature @@ -0,0 +1,39 @@ +@ProcessMakerMichelangelo @RestAPI @adhoc-assignee @negative +Feature: Project Properties -Adhoc Assignee Resources - Negative tests + + Background: + Given that I have a valid access_token + +Scenario Outline: List assignees of an activity with bad parameters + Given I request "project//activity//adhoc-assignee" + Then the response status code should be 400 + + + Examples: + | test_description | project | activity | + | Use an invalid project ID and empty activity | 4224292655297723eb98691001100052 | 1234556 | + | Use an invalid project ID | 122134324 | 65496814252977243d57684076211485 | + | Use an invalid activity ID | 345345345 | 345345345 | + + + Scenario Outline: Assign a user or group to an activity (Field validation) + Given POST this data: + """ + { + "ass_uid": "", + "ass_type": "" + } + """ + And I request "project//activity//adhoc-assignee" + Then the response status code should be 400 + And the type is "object" + + + Examples: + | test_description | project | activity | aas_uid | aas_type | + | Asignando un user inexistente | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | | | + | Asignando un usuario Con tipo inexistente | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | !@#$%^&*()_+=-[]{};:~, | user | + | Asignando un usuario como grupo | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 15746307552d00a66624889076110382 | group | + | Asignando un usuario con type inexistente | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | department | + + diff --git a/features/backend/project_property_assignee_resources/activity_assignee.feature b/features/backend/project_property_assignee_resources/activity_assignee.feature index aeda6ed74..28ec9b60b 100644 --- a/features/backend/project_property_assignee_resources/activity_assignee.feature +++ b/features/backend/project_property_assignee_resources/activity_assignee.feature @@ -15,10 +15,10 @@ Feature: Project Properties - Assignee Resources And the "aas_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 82 | 35762872152cda4323207c6035916735 | group | + | test_description | project | activity | records | aas_uid | aas_type | + | check if the list of possible users and groups to be assigned is correct | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 82 | 54731929352d56741de9d42002704749 | group | -Scenario Outline: Get a list of available users and groups to be assigned to an activity with filter +Scenario Outline: Get a list of available users and groups to be assigned to an activity using filter Given I request "project//activity//available-assignee?filter=&start=&limit=" Then the response status code should be 200 And the response charset is "UTF-8" @@ -29,33 +29,33 @@ Scenario Outline: Get a list of available users and groups to be assigned to an And the "aas_type" property in row 0 equals "" Examples: - | project | activity | filter | start | limit | records | aas_uid | aas_type| - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | departa | 0 | 50 | 3 | 90268877852b7b4b9f134b1096735994 | group | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | departa | 0 | 1 | 1 | 90268877852b7b4b9f134b1096735994 | group | + | test_description | project | activity | filter | start | limit | records | aas_uid | aas_type| + | Using filter get available users that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 50 | 2 | 66623507552d56742865613066097298 | group | + | Using filter get 1 available user that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 1 | 1 | 66623507552d56742865613066097298 | group | - Scenario Outline: Assign a user or group to an activity + Scenario Outline: Assign 2 users and 2 group to an activity Given POST this data: -""" -{ - "aas_uid": "", - "aas_type": "" -} -""" + """ + { + "aas_uid": "", + "aas_type": "" + } + """ And I request "project//activity//assignee" Then the response status code should be 201 And the type is "object" Examples: - | project | activity | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 66386662252cda3f9a63226052377198 | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 35762872152cda4323207c6035916735 | group | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 90706007452cda42ed1c326093152317 | group | + | test_description | project | activity | aas_uid | aas_type | + | assign a user to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | + | assign a user to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 25286582752d56713231082039265791 | user | + | assign a group to the first task | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 54731929352d56741de9d42002704749 | group | + | assign a group to the second task | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 | group | - Scenario Outline: After assignation - List assignees of an activity + Scenario Outline: After assignation - List assignees of each activity Given I request "project//activity//assignee" Then the response status code should be 200 And the response charset is "UTF-8" @@ -66,12 +66,12 @@ Scenario Outline: Get a list of available users and groups to be assigned to an And the "aas_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 7 | 135762872152cda4323207c6035916735 | group | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 5 | 90706007452cda42ed1c326093152317 | group | + | test_description | project | activity | records | aas_uid | aas_type | + | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 7 | 54731929352d56741de9d42002704749 | group | + | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 5 | 36775342552d5674146d9c2078497230 | group | -Scenario Outline: List assignees of an activity with filter +Scenario Outline: List assignees of an activity using a filter Given I request "project//activity//assignee?filter=" Then the response status code should be 200 And the response charset is "UTF-8" @@ -82,9 +82,9 @@ Scenario Outline: List assignees of an activity with filter And the "aas_type" property in row 0 equals "" Examples: - | project | activity | records | aas_uid | aas_type | filter | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 1 | 69191356252cda41acde328048794164 | user | oli | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 90706007452cda42ed1c326093152317 | group | dep | + | test_description | project | activity | records | aas_uid | aas_type | filter | + | Filtered list should return 1 record | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 1 | 73005191052d56727901138030694610 | user | oli | + | Filtered list should return 1 record | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 36775342552d5674146d9c2078497230 | group | emp | Scenario Outline: Get a single user or group of an activity Given I request "project//activity//assignee/" @@ -99,8 +99,8 @@ Scenario Outline: List assignees of an activity with filter And the "aas_type" property equals "" Examples: - | project | activity | aas_uid | aas_type | aas_name | aas_lastname | aas_username | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | user | Olivia | Austin | olivia | + | test_description | project | activity | aas_uid | aas_type | aas_name | aas_lastname | aas_username | + | Obtain details of user assigend to an activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | Olivia | Austin | olivia | Scenario Outline: Remove assignee from an activity Given that I want to delete a resource with the key "aas_uid" stored in session array @@ -108,11 +108,11 @@ Scenario Outline: List assignees of an activity with filter Then the response status code should be 200 Examples: - | project | activity | aas_uid | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 66386662252cda3f9a63226052377198 | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 35762872152cda4323207c6035916735 | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 90706007452cda42ed1c326093152317 | + | test_description | project | activity | aas_uid | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 25286582752d56713231082039265791 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 54731929352d56741de9d42002704749 | + | Remove a user from activity | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 | @@ -123,40 +123,4 @@ Scenario Outline: List assignees of an activity with filter And the content type is "application/json" And the type is "array" And the response has 4 records - - Scenario Outline: List assignees of an activity with bad parameters - Given I request "project//activity//assignee" - Then the response status code should be 400 - - - Examples: - | project | activity | - | 4224292655297723eb98691001100052 | 1234556 | - | 122134324 | 65496814252977243d57684076211485 | - | 345345345 | 345345345 | - | | | - - -Scenario Outline: Assign a user or group to an activity (Field validation) - Given POST this data: -""" -{ - "ass_uid": "", - "ass_type": "" -} -""" - And I request "project//activity//assignee" - Then the response status code should be 400 - And the type is "object" - - # Asignando un user inexistente - # Asignando un usuario como grupo - # Asignando un usuario con type inexistente - Examples: - - | project | activity | aas_uid | aas_type | - | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | | | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | !@#$%^&*()_+=-[]{};:~, | user | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | group | - | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | department | - \ No newline at end of file + \ No newline at end of file diff --git a/features/backend/project_property_assignee_resources/negative_tests.feature b/features/backend/project_property_assignee_resources/negative_tests.feature new file mode 100644 index 000000000..725c91d60 --- /dev/null +++ b/features/backend/project_property_assignee_resources/negative_tests.feature @@ -0,0 +1,39 @@ +@ProcessMakerMichelangelo @RestAPI @assignee @negative +Feature: Project Properties -Assignee Resources - Negative tests + + Background: + Given that I have a valid access_token + + +Scenario Outline: List assignees of an activity with bad parameters + Given I request "project//activity//assignee" + Then the response status code should be 400 + + Examples: + | test_description | project | activity | + | Use an invalid project ID and empty activity | 4224292655297723eb98691001100052 | 1234556 | + | Use an invalid project ID | 122134324 | 65496814252977243d57684076211485 | + | Use an invalid activity ID | 345345345 | 345345345 | + + +Scenario Outline: Assign a user or group to an activity (Field validation) + Given POST this data: + """ + { + "ass_uid": "", + "ass_type": "" + } + """ + And I request "project//activity//assignee" + Then the response status code should be 400 + And the type is "object" + + + Examples: + + | test_description | project | activity | aas_uid | aas_type | + | Asignando un user inexistente | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | | | + | Asignando un usuario Con tipo inexistente | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | !@#$%^&*()_+=-[]{};:~, | user | + | Asignando un usuario como grupo | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | group | + | Asignando un usuario con type inexistente | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | department | + diff --git a/features/backend/triggers_resources/main_tests.feature b/features/backend/triggers_resources/main_tests.feature new file mode 100644 index 000000000..a2aef538f --- /dev/null +++ b/features/backend/triggers_resources/main_tests.feature @@ -0,0 +1,143 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Testing triggers Main Tests + Requirements: + a workspace with the process 251815090529619a99a2bf4013294414 already loaded + the process name is "Test - Triggers" + there are two triggers in the process + Background: + Given that I have a valid access_token + + + Scenario: Get the Triggers List when there are exactly two triggers + Given I request "project/251815090529619a99a2bf4013294414/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 2 records + And the "tri_title" property in row 0 equals "For event: change description" + And the "tri_title" property in row 1 equals "para eventos" + + + + Scenario: Get a single trigger of a project + the trigger is previously created + Given I request "project/251815090529619a99a2bf4013294414/trigger/65317729852cf0ce339bfa4020392914" + 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 the "tri_title" property equals "For event: change description" + And the "tri_description" property equals "Autogenerated For event: change description" + + + Scenario Outline: Create 3 new triggers + Given POST this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_webbot": "", + "tri_param": "" + } + """ + And I request "project//trigger" + Then the response status code should be 201 + And store "tri_uid" in session array as variable "tri_uid_" + + Examples: + + | test_description | project | tri_number | tri_title | tri_description |tri_type | tri_webbot | tri_param | + | Create trigger with title alphabetic and with webbot | 251815090529619a99a2bf4013294414 | 1 | nuevo trigger 1 | descripcion del primer trigger 1 |SCRIPT | @@user1 = @@USER_LOGGED; \n $x = rand(); | PRIVATE | + | Create trigger with title alphanumeric and with webbot | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | descripcion del segundo trigger 2 |SCRIPT | //Trigger with comments | PRIVATE | + | Create trigger without webbot | 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 |SCRIPT | | PRIVATE | + | Create trigger without tri type | 251815090529619a99a2bf4013294414 | 4 | otro trigger 4 | descripcion del tercer trigger 4 | | | PRIVATE | + | Create trigger without tri param | 251815090529619a99a2bf4013294414 | 5 | otro trigger 5 | descripcion del tercer trigger 5 | | | | + + + Scenario: Get the Triggers List when there are 7 records + Given I request "project/251815090529619a99a2bf4013294414/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 7 records + + + + Scenario Outline: Update the Triggers and then check if the values had changed + Given PUT this data: + """ + { + "tri_title": "", + tri_description": "", + "tri_type": "", + "tri_webbot": "", + "tri_param": "" + } + """ + 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//trigger" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | test_description | project | tri_number | tri_title | tri_description |tri_type | tri_webbot | tri_param | + | Update title | 251815090529619a99a2bf4013294414 | 1 | Update nuevo trigger 1 @#$%^&*½²³€¼½ | descripcion del primer trigger 1 |SCRIPT | @@user1 = @@USER_LOGGED; \n $x = rand(); | PRIVATE | + | Update Description | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | Update descripcion del segundo trigger 2 @#$%^&*½²³€¼½ |SCRIPT | //Trigger with comments | PRIVATE | + | Update webbot | 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 |SCRIPT | //Trigger with comments update | PRIVATE | + + + + Scenario Outline: Get a single triggers and check some properties + 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//trigger" + 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_webbot" is set to "" + + Examples: + + | project | tri_number | tri_title | tri_description | tri_webbot | + | 251815090529619a99a2bf4013294414 | 1 | Update nuevo trigger 1 @#$%^&*½²³€¼½ | descripcion del primer trigger 1 | @@user1 = @@USER_LOGGED; \n $x = rand(); | + | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | Update descripcion del segundo trigger 2 @#$%^&*½²³€¼½ | //Trigger with comments | + | 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 | //Trigger with comments update | + + + + Scenario Outline: Delete all Triggers created previously in this script + 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//trigger" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | project | tri_number | + | 251815090529619a99a2bf4013294414 | 1 | + | 251815090529619a99a2bf4013294414 | 2 | + | 251815090529619a99a2bf4013294414 | 3 | + | 251815090529619a99a2bf4013294414 | 4 | + | 251815090529619a99a2bf4013294414 | 5 | + + + Scenario: Get the Triggers List when there are exactly two triggers + Given I request "project/251815090529619a99a2bf4013294414/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 2 records + And the "tri_title" property in row 0 equals "For event: change description" + And the "tri_title" property in row 1 equals "para eventos" + + + + diff --git a/features/backend/triggers_resources/negative_tests.feature b/features/backend/triggers_resources/negative_tests.feature new file mode 100644 index 000000000..700d70c80 --- /dev/null +++ b/features/backend/triggers_resources/negative_tests.feature @@ -0,0 +1,28 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Triggers Negative Tests + + + Background: + Given that I have a valid access_token + + Scenario Outline: Create a new Triggers for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "tri_title": "", + "tri_description": "", + "tri_type": "", + "tri_webbot": "", + "tri_param": "" + } + """ + And I request "project//trigger" + Then the response status code should be + And the response status message should have the following text "" + + Examples: + + | test_description | project | tri_title | tri_description |tri_type | error_code | error_message | + | Invalid tri type | 251815090529619a99a2bf4013294414 | Trigger 5 | Trigger valores invalidos |Value12@#$| 400 | tri_type | + | Field required tri title | 251815090529619a99a2bf4013294414 | | Trigger con nombre en blanco |SCRIPT | 400 | tri_title | + \ No newline at end of file diff --git a/features/backend/triggers_resources/triggers.feature b/features/backend/triggers_resources/triggers.feature deleted file mode 100644 index 4029987fd..000000000 --- a/features/backend/triggers_resources/triggers.feature +++ /dev/null @@ -1,126 +0,0 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Testing triggers - - Background: - Given that I have a valid access_token - - @1: TEST FOR POST TRIGGER /-------------------------------------------------------------------- - Scenario Outline: Get a list of triggers of a project - Given I request "project//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 records - - Examples: - | project | records | - | 251815090529619a99a2bf4013294414 | 0 | - - @2: TEST FOR POST TRIGGER /-------------------------------------------------------------------- - Scenario Outline: Create a trigger - - Given POST this data: - """ - { - "tri_title": "", - "tri_description": "", - "tri_type": "", - "tri_webbot": "", - "tri_param": "PRIVATE" - } - """ - And I request "project//trigger" - Then the response status code should be 201 - And store "tri_uid" in session array as variable "tri_uid_" - - Examples: - - | project | tri_number | tri_title | tri_description |tri_type | tri_webbot | - | 251815090529619a99a2bf4013294414 | 1 | nuevo trigger 2 | descripcion |SCRIPT | @@user1 = @@USER_LOGGED; \n $x = rand();| - | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | descripcion de otro trigger |SCRIPT | //Trigger with comments | - - - @3: TEST FOR PUT TRIGGER /----------------------------------------------------------------------- - Scenario Outline: Update a trigger - - Given PUT this data: - """ - { - "tri_title": "", - "tri_description": "" - } - """ - 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//trigger" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | project | tri_number | tri_title | tri_description | - | 251815090529619a99a2bf4013294414 | 1 | trigger editado 2 | descripcion editada | - | 251815090529619a99a2bf4013294414 | 2 | otro trigger editado 2 | descripcion de otro trigger editado | - - - @4: TEST FOR GET TRIGGER /----------------------------------------------------------------------- - Scenario Outline: Get a trigger - - 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//trigger" - 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 "" - - Examples: - - | project | tri_number | tri_title | tri_description | - | 251815090529619a99a2bf4013294414 | 1 | trigger editado 2 | descripcion editada | - | 251815090529619a99a2bf4013294414 | 2 | otro trigger editado 2 | descripcion de otro trigger editado | - - - - @5: TEST FOR DELETE TRIGGER /----------------------------------------------------------------------- - Scenario Outline: Get a trigger - - 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//trigger" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | project | tri_number | - | 251815090529619a99a2bf4013294414 | 1 | - | 251815090529619a99a2bf4013294414 | 2 | - - - - - @6: TEST FOR POST TRIGGER /-------------------------------------------------------------------- - Scenario Outline: Create a trigger - - Given POST this data: - """ - { - "tri_title": "", - "tri_description": "" - "tri_type": "", - "tri_webbot": "", - "tri_param": "PRIVATE" - } - """ - And I request "project//trigger" - Then the response status code should be 400 - - Examples: - - | project | tri_title | tri_description |tri_type | - | 251815090529619a99a2bf4013294414 | Especial !@#$%^&*(){[/½‘€¤@ | Trigger con caracteres especiales |SCRIPT | - | 251815090529619a99a2bf4013294414 | | Trigger con nombre en blanco |SCRIPT | - | 251815090529619a99a2bf4013294414 | Trigger 3 | Descripcion con caracteres especiales !@#$%^&*(){[/½‘€¤@ |SCRIPT | - | 251815090529619a99a2bf4013294414 | Trigger 4 | descripcion |SCRI123%@$| diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 07220c777..35cb67158 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -52,6 +52,7 @@ class FeatureContext extends BehatContext } + // // Place your definition and hook methods here: // diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index ee0c7cd57..dcf4dc1f9 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1179,6 +1179,35 @@ class RestContext extends BehatContext $this->_restObjectMethod = 'delete'; } + /** + * @Given /^the response status message should have the following text "([^"]*)"$/ + */ + public function theResponseStatusMessageShouldHaveTheFollowingText($arg1) + { + + $message=""; + if($bodyResponse=json_decode($this->_response->getBody(true))){ + if(isset($bodyResponse->error->message)){ + $message = $bodyResponse->error->message; + if (strpos($message,$arg1) === false) { + throw new \Exception("Error message text does not have: '" . $arg1 ."'' (actual: '$message')\n\n"); + } + + + }else{ + throw new \Exception('This is not a valid error response'); + + } + + }else{ + throw new \Exception('This is not a valid response'); + + } + + + + } + } diff --git a/workflow/engine/src/BusinessModel/InputDocument.php b/workflow/engine/src/BusinessModel/InputDocument.php index c657422b2..563429540 100644 --- a/workflow/engine/src/BusinessModel/InputDocument.php +++ b/workflow/engine/src/BusinessModel/InputDocument.php @@ -3,34 +3,6 @@ namespace BusinessModel; class InputDocument { - /** - * Get data of unique ids of an InputDocument (Unique id of Process) - * - * @param string $inputDocumentUid Unique id of InputDocument - * - * return array - */ - public function getDataUids($inputDocumentUid) - { - try { - $criteria = new \Criteria("workflow"); - - $criteria->addSelectColumn(\InputDocumentPeer::PRO_UID); - $criteria->add(\InputDocumentPeer::INP_DOC_UID, $inputDocumentUid, \Criteria::EQUAL); - - $rsCriteria = \InputDocumentPeer::doSelectRS($criteria); - $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - if ($rsCriteria->next()) { - return $rsCriteria->getRow(); - } else { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($inputDocumentUid, "INPUT_DOCUMENT"), "The UID \"{0}\" doesn't exist in table {1}"))); - } - } catch (\Exception $e) { - throw $e; - } - } - /** * Verify if the title exists in the InputDocuments of Process * @@ -78,30 +50,6 @@ class InputDocument } } - /** - * Get data from a request data - * - * @param object $requestData Request data - * - * return array Return an array with data of request data - */ - public function getArrayDataFromRequestData($requestData) - { - try { - $arrayData = array(); - - $requestData = (array)($requestData); - - foreach ($requestData as $key => $value) { - $arrayData[$key] = $value; - } - - return $arrayData; - } catch (\Exception $e) { - throw $e; - } - } - /** * Create InputDocument for a Process * @@ -124,20 +72,43 @@ class InputDocument throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}"))); } + if (!isset($arrayData["INP_DOC_TITLE"])) { + throw (new \Exception(str_replace(array("{0}"), array("INP_DOC_TITLE"), "The \"{0}\" attribute is not defined"))); + } + + if (isset($arrayData["INP_DOC_TITLE"]) && trim($arrayData["INP_DOC_TITLE"]) == "") { + throw (new \Exception(str_replace(array("{0}"), array("INP_DOC_TITLE"), "The \"{0}\" attribute is empty"))); + } + if (isset($arrayData["INP_DOC_TITLE"]) && $this->titleExists($processUid, $arrayData["INP_DOC_TITLE"])) { throw (new \Exception(\G::LoadTranslation("ID_INPUT_NOT_SAVE"))); } + //Flags + $flagDataDestinationPath = (isset($arrayData["INP_DOC_DESTINATION_PATH"]))? 1 : 0; + $flagDataTags = (isset($arrayData["INP_DOC_TAGS"]))? 1 : 0; + //Create - $inputdoc = new \InputDocument(); + $inputDocument = new \InputDocument(); $arrayData["PRO_UID"] = $processUid; - $inputDocumentUid = $inputdoc->create($arrayData); + $arrayData["INP_DOC_DESTINATION_PATH"] = ($flagDataDestinationPath == 1)? $arrayData["INP_DOC_DESTINATION_PATH"] : ""; + $arrayData["INP_DOC_TAGS"] = ($flagDataTags == 1)? $arrayData["INP_DOC_TAGS"] : ""; + + $inputDocumentUid = $inputDocument->create($arrayData); //Return unset($arrayData["PRO_UID"]); + if ($flagDataDestinationPath == 0) { + unset($arrayData["INP_DOC_DESTINATION_PATH"]); + } + + if ($flagDataTags == 0) { + unset($arrayData["INP_DOC_TAGS"]); + } + $arrayData = array_change_key_case($arrayData, CASE_LOWER); unset($arrayData["inp_doc_uid"]); @@ -161,19 +132,22 @@ class InputDocument try { $arrayData = array_change_key_case($arrayData, CASE_UPPER); - //Verify data - $inputdoc = new \InputDocument(); + $inputDocument = new \InputDocument(); - if (!$inputdoc->InputExists($inputDocumentUid)) { + $arrayInputDocumentData = $inputDocument->load($inputDocumentUid); + + //Uids + $processUid = $arrayInputDocumentData["PRO_UID"]; + + //Verify data + if (!$inputDocument->InputExists($inputDocumentUid)) { throw (new \Exception(str_replace(array("{0}", "{1}"), array($inputDocumentUid, "INPUT_DOCUMENT"), "The UID \"{0}\" doesn't exist in table {1}"))); } - //Uids - $arrayDataUid = $this->getDataUids($inputDocumentUid); + if (isset($arrayData["INP_DOC_TITLE"]) && trim($arrayData["INP_DOC_TITLE"]) == "") { + throw (new \Exception(str_replace(array("{0}"), array("INP_DOC_TITLE"), "The \"{0}\" attribute is empty"))); + } - $processUid = $arrayDataUid["PRO_UID"]; - - //Verify data if (isset($arrayData["INP_DOC_TITLE"]) && $this->titleExists($processUid, $arrayData["INP_DOC_TITLE"], $inputDocumentUid)) { throw (new \Exception(\G::LoadTranslation("ID_INPUT_NOT_SAVE"))); } @@ -181,7 +155,7 @@ class InputDocument //Update $arrayData["INP_DOC_UID"] = $inputDocumentUid; - $result = $inputdoc->update($arrayData); + $result = $inputDocument->update($arrayData); //Return unset($arrayData["INP_DOC_UID"]); @@ -203,9 +177,9 @@ class InputDocument { try { //Verify data - $inputdoc = new \InputDocument(); + $inputDocument = new \InputDocument(); - if (!$inputdoc->InputExists($inputDocumentUid)) { + if (!$inputDocument->InputExists($inputDocumentUid)) { throw (new \Exception(str_replace(array("{0}", "{1}"), array($inputDocumentUid, "INPUT_DOCUMENT"), "The UID \"{0}\" doesn't exist in table {1}"))); } @@ -226,9 +200,9 @@ class InputDocument } //InputDocument - $inputdoc = new \InputDocument(); + $inputDocument = new \InputDocument(); - $result = $inputdoc->remove($inputDocumentUid); + $result = $inputDocument->remove($inputDocumentUid); //Step $step = new \Step(); @@ -297,11 +271,11 @@ class InputDocument public function getInputDocumentDataFromRecord($record) { try { - $inputdoc = new \InputDocument(); - if ($record["INP_DOC_TITLE"] . "" == "") { + $inputDocument = new \InputDocument(); + //There is no transaltion for this Document name, try to get/regenerate the label - $arrayInputdocData = $inputdoc->load($record["INP_DOC_UID"]); + $arrayInputdocData = $inputDocument->load($record["INP_DOC_UID"]); $record["INP_DOC_TITLE"] = $arrayInputdocData["INP_DOC_TITLE"]; $record["INP_DOC_DESCRIPTION"] = $arrayInputdocData["INP_DOC_DESCRIPTION"]; @@ -334,9 +308,9 @@ class InputDocument { try { //Verify data - $inputdoc = new \InputDocument(); + $inputDocument = new \InputDocument(); - if (!$inputdoc->InputExists($inputDocumentUid)) { + if (!$inputDocument->InputExists($inputDocumentUid)) { throw (new \Exception(str_replace(array("{0}", "{1}"), array($inputDocumentUid, "INPUT_DOCUMENT"), "The UID \"{0}\" doesn't exist in table {1}"))); } diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project.php b/workflow/engine/src/Services/Api/ProcessMaker/Project.php index a15b82420..b5ac779e2 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project.php @@ -167,6 +167,8 @@ class Project extends Api /** * @url GET /:projectUid/input-documents + * + * @param string $projectUid {@min 32}{@max 32} */ public function doGetInputDocuments($projectUid) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php index d11d4c75f..410a45acb 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php @@ -13,6 +13,9 @@ class InputDocument extends Api { /** * @url GET /:projectUid/input-document/:inputDocumentUid + * + * @param string $inputDocumentUid {@min 32}{@max 32} + * @param string $projectUid {@min 32}{@max 32} */ public function doGetInputDocument($inputDocumentUid, $projectUid) { @@ -30,19 +33,35 @@ class InputDocument extends Api /** * @url POST /:projectUid/input-document * - * @param string $projectUid - * @param InputDocumentPostStructure $request_data + * @param string $projectUid {@min 32}{@max 32} + * @param array $request_data + * @param string $inp_doc_title {@from body} + * @param string $inp_doc_description {@from body} + * @param string $inp_doc_form_needed {@from body}{@choice VIRTUAL,REAL,VREAL} + * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY} + * @param string $inp_doc_published {@from body}{@choice PRIVATE} + * @param int $inp_doc_versioning {@from body}{@choice 0,1} + * @param string $inp_doc_destination_path {@from body} + * @param string $inp_doc_tags {@from body} * * @status 201 */ - public function doPostInputDocument($projectUid, InputDocumentPostStructure $request_data = null) - { + public function doPostInputDocument( + $projectUid, + $request_data, + $inp_doc_title = "", + $inp_doc_description = "", + $inp_doc_form_needed = "VIRTUAL", + $inp_doc_original = "ORIGINAL", + $inp_doc_published = "PRIVATE", + $inp_doc_versioning = 0, + $inp_doc_destination_path = "", + $inp_doc_tags = "" + ) { try { $inputdoc = new \BusinessModel\InputDocument(); - $arrayData = $inputdoc->getArrayDataFromRequestData($request_data); - - $arrayData = $inputdoc->create($projectUid, $arrayData); + $arrayData = $inputdoc->create($projectUid, $request_data); $response = $arrayData; @@ -55,18 +74,35 @@ class InputDocument extends Api /** * @url PUT /:projectUid/input-document/:inputDocumentUid * - * @param string $inputDocumentUid - * @param string $projectUid - * @param InputDocumentPutStructure $request_data + * @param string $inputDocumentUid {@min 32}{@max 32} + * @param string $projectUid {@min 32}{@max 32} + * @param array $request_data + * @param string $inp_doc_title {@from body} + * @param string $inp_doc_description {@from body} + * @param string $inp_doc_form_needed {@from body}{@choice VIRTUAL,REAL,VREAL} + * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY} + * @param string $inp_doc_published {@from body}{@choice PRIVATE} + * @param int $inp_doc_versioning {@from body}{@choice 0,1} + * @param string $inp_doc_destination_path {@from body} + * @param string $inp_doc_tags {@from body} */ - public function doPutInputDocument($inputDocumentUid, $projectUid, InputDocumentPutStructure $request_data = null) - { + public function doPutInputDocument( + $inputDocumentUid, + $projectUid, + $request_data, + $inp_doc_title = "", + $inp_doc_description = "", + $inp_doc_form_needed = "VIRTUAL", + $inp_doc_original = "ORIGINAL", + $inp_doc_published = "PRIVATE", + $inp_doc_versioning = 0, + $inp_doc_destination_path = "", + $inp_doc_tags = "" + ) { try { $inputdoc = new \BusinessModel\InputDocument(); - $arrayData = $inputdoc->getArrayDataFromRequestData($request_data); - - $arrayData = $inputdoc->update($inputDocumentUid, $arrayData); + $arrayData = $inputdoc->update($inputDocumentUid, $request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } @@ -74,6 +110,9 @@ class InputDocument extends Api /** * @url DELETE /:projectUid/input-document/:inputDocumentUid + * + * @param string $inputDocumentUid {@min 32}{@max 32} + * @param string $projectUid {@min 32}{@max 32} */ public function doDeleteInputDocument($inputDocumentUid, $projectUid) { @@ -87,89 +126,3 @@ class InputDocument extends Api } } -class InputDocumentPostStructure -{ - /** - * @var string {@from body}{@required true} - */ - public $inp_doc_title; - - /** - * @var string {@from body} - */ - public $inp_doc_description; - - /** - * @var string {@from body}{@choice VIRTUAL,REAL,VREAL} - */ - public $inp_doc_form_needed; - - /** - * @var string {@from body}{@choice ORIGINAL,COPY} - */ - public $inp_doc_original; - - /** - * @var string {@from body}{@choice PRIVATE} - */ - public $inp_doc_published; - - /** - * @var int {@from body}{@choice 0,1} - */ - public $inp_doc_versioning; - - /** - * @var string {@from body} - */ - public $inp_doc_destination_path; - - /** - * @var string {@from body} - */ - public $inp_doc_tags; -} - -class InputDocumentPutStructure -{ - /** - * @var string {@from body} - */ - public $inp_doc_title; - - /** - * @var string {@from body} - */ - public $inp_doc_description; - - /** - * @var string {@from body}{@choice VIRTUAL,REAL,VREAL} - */ - public $inp_doc_form_needed; - - /** - * @var string {@from body}{@choice ORIGINAL,COPY} - */ - public $inp_doc_original; - - /** - * @var string {@from body}{@choice PRIVATE} - */ - public $inp_doc_published; - - /** - * @var int {@from body}{@choice 0,1} - */ - public $inp_doc_versioning; - - /** - * @var string {@from body} - */ - public $inp_doc_destination_path; - - /** - * @var string {@from body} - */ - public $inp_doc_tags; -} -