From f884c82c306c34e3d1a6de5f6be66a743ea2777a Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Thu, 26 Jun 2014 10:18:17 -0400 Subject: [PATCH] Arreglos en los features file manager y process permissions --- .../main_test_files_manager.feature | 376 +++++++++--------- .../main_tests_permissions.feature | 49 +-- 2 files changed, 218 insertions(+), 207 deletions(-) diff --git a/features/backend/projects/files_manager/main_test_files_manager.feature b/features/backend/projects/files_manager/main_test_files_manager.feature index 122c14173..5990f29d8 100644 --- a/features/backend/projects/files_manager/main_test_files_manager.feature +++ b/features/backend/projects/files_manager/main_test_files_manager.feature @@ -1,219 +1,227 @@ @ProcessMakerMichelangelo @RestAPI Feature: Files Manager Resources Main Tests Requirements: - a workspace with the process 1265557095225ff5c688f46031700471 ("Test Michelangelo") already loaded - there are two output documents in the process + a workspace with the process 1265557095225ff5c688f46031700471 ("Test Michelangelo") already loaded + there are two output documents in the process - Background: - Given that I have a valid access_token +Background: + Given that I have a valid access_token - Scenario: Get a list of main process files manager - Given I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the "name" property in row 0 equals "templates" - And the "name" property in row 1 equals "public" +Scenario: Get a list of main process files manager + Given I request "project/1265557095225ff5c688f46031700471/file-manager" + 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 "name" property in row 0 equals "templates" + And the "name" property in row 1 equals "public" - Scenario: Get a list public folder of process files manager +Scenario: Get a list public folder of process files manager Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=public" - 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 0 records + 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 0 records - Scenario: Get a list templates folder of process files manager +Scenario: Get a list templates folder of process files manager Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 2 records + 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 - Scenario Outline: Create files and subfolders +Scenario Outline: Create files and subfolders Given POST this data: - """ - { - "prf_filename": "", - "prf_path": "", - "prf_content": "" - } - """ - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "" - And store "prf_uid" in session array as variable "prf_uid_" - - Examples: - | test_description | prf_filename | prf_path | prf_content | http_code | type | prf_number | - | into public folder | file_test_1.txt | public/ | only text | 200 | object | 0 | - | into mailtemplates folder | file_test_2.html | templates/ |

Test

html test

| 200 | object | 1 | - | into public subfolder | file_test_3 | public/public_subfolder | test | 200 | object | 2 | - | into mailtemplates subfolder | file_test_4 | templates/templates_subfolder | test | 200 | object | 3 | - - - Scenario: Create files and subfolders with same name in path public - Given POST this data: - """ - { - "prf_filename": "file_test_1.txt", - "prf_path": "public/", - "prf_content": "only text" - } - """ - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 400 - And the response status message should have the following text "already exists" - - - Scenario: Create files and subfolders with same name in path templates - Given POST this data: - """ - { - "prf_filename": "file_test_2.html", - "prf_path": "templates/", - "prf_content": "

Test

html test

" - } - """ - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 400 - And the response status message should have the following text "already exists" - - - Scenario Outline: Update files by updating the content - Given PUT this data: - """ - { - "prf_content": "" - } - """ - And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid_" - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "" - - Examples: - | test_description | prf_filename | prf_content | http_code | type | prf_number | - | put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | - | put into mailtemplates folder | file_test_2.html |

Test

html test

modified | 200 | object | 1 | - | put into public subfolder | file_test_3 | put test | 200 | object | 2 | - | put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 | - - - Scenario Outline: Get a single Files Manager and check some properties - Given that I want to get a resource with the key "prf_uid" stored in session array as variable "prf_uid_" - Given I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "object" - And that "prf_filename" is set to "" - And that "prf_path" is set to "" - And that "prf_content" is set to "" - - Examples: - | test_description | prf_filename | prf_content | http_code | type | prf_number | row | prf_path | - | put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | 1 | public/ | - | put into mailtemplates folder | file_test_2.html |

Test

html test

modified | 200 | object | 1 | 1 | templates/ | - | put into public subfolder | file_test_3 | put test | 200 | object | 2 | 0 | public/public_subfolder | - | put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 | 0 | templates/templates_subfolder | - - - Scenario Outline: Upload files to same folders - Given POST I want to upload the file "" to path "". Url "project/1265557095225ff5c688f46031700471/file-manager" - And store "prf_uid" in session array as variable "prf_uid_" - - Examples: - | file | prf_path | prf_number | - |/home/wendy/uploadfiles/test1.html | templates | 4 | - |/home/wendy/uploadfiles/test2.html | templates | 5 | - |/home/wendy/uploadfiles/test.txt | public | 6 | - |/home/wendy/uploadfiles/TestQA.html| templates | 7 | - - - - - Scenario Outline: Verify if TestQA was overwrited - Given that I want to get a resource with the key "prf_uid" stored in session array as variable "prf_uid_" - Given I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "object" - And that "prf_filename" is set to "" - And that "prf_content" is set to "" + """ + { + "prf_filename": "", + "prf_path": "", + "prf_content": "" + } + """ + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And store "prf_uid" in session array as variable "prf_uid_" Examples: - | prf_ filename | prf_content | prf_number | - | TestQA.html | Test QA - cuando se realiza la sobreescritura desde upload | 7 | + | test_description | prf_filename | prf_path | prf_content | http_code | type | prf_number | + | into public folder | file_test_1.txt | public/ | only text | 200 | object | 0 | + | into mailtemplates folder | file_test_2.html | templates/ |

Test

html test

| 200 | object | 1 | + | into public subfolder | file_test_3 | public/public_subfolder | test | 200 | object | 2 | + | into mailtemplates subfolder | file_test_4 | templates/templates_subfolder | test | 200 | object | 3 | + +Scenario: Create files and subfolders with same name in path public + Given POST this data: + """ + { + "prf_filename": "file_test_1.txt", + "prf_path": "public/", + "prf_content": "only text" + } + """ + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 400 + And the response status message should have the following text "already exists" + + +Scenario: Create files and subfolders with same name in path templates + Given POST this data: + """ + { + "prf_filename": "file_test_2.html", + "prf_path": "templates/", + "prf_content": "

Test

html test

" + } + """ + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 400 + And the response status message should have the following text "already exists" + + +Scenario Outline: Update files by updating the content + Given PUT this data: + """ + { + "prf_content": "" + } + """ + And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid_" + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + + Examples: + | test_description | prf_filename | prf_content | http_code | type | prf_number | + | put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | + | put into mailtemplates folder | file_test_2.html |

Test

html test

modified | 200 | object | 1 | + | put into public subfolder | file_test_3 | put test | 200 | object | 2 | + | put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 | + + +Scenario Outline: Get a single Files Manager and check some properties + Given that I want to get a resource with the key "prf_uid" stored in session array as variable "prf_uid_" + Given I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And that "prf_filename" is set to "" + And that "prf_path" is set to "" + And that "prf_content" is set to "" + + Examples: + | test_description | prf_filename | prf_content | http_code | type | prf_number | row | prf_path | + | put into public folder | file_test_1.txt | only text - modified | 200 | object | 0 | 1 | public/ | + | put into mailtemplates folder | file_test_2.html |

Test

html test

modified | 200 | object | 1 | 1 | templates/ | + | put into public subfolder | file_test_3 | put test | 200 | object | 2 | 0 | public/public_subfolder | + | put into mailtemplates subfolder | file_test_4 | put test | 200 | object | 3 | 0 | templates/templates_subfolder | + + +Scenario Outline: Upload files to same folders + Given POST I want to upload the file "" to path "". Url "project/1265557095225ff5c688f46031700471/file-manager" + And store "prf_uid" in session array as variable "prf_uid_" + + Examples: + | file | prf_path | prf_number | + |/home/wendy/uploadfiles/test1.html | templates | 4 | + |/home/wendy/uploadfiles/test2.html | templates | 5 | + |/home/wendy/uploadfiles/test.txt | public | 6 | + |/home/wendy/uploadfiles/TestQA.html| templates | 7 | + + +Scenario Outline: Verify if TestQA was overwrited + Given that I want to get a resource with the key "prf_uid" stored in session array as variable "prf_uid_" + Given I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And that "prf_filename" is set to "" + And that "prf_content" is set to "" + + Examples: + | prf_ filename | prf_content | prf_number | + | TestQA.html | Test QA - cuando se realiza la sobreescritura desde upload | 7 | - Scenario Outline: Update the overwritten file to return to their original values +Scenario Outline: Update the overwritten file to return to their original values Given PUT this data: - """ - { - "prf_content": "Test QA" - } - """ - And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid_" - And I request "project/1265557095225ff5c688f46031700471/file-manager" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And that "prf_filename" is set to "TestQA.html" - And that "prf_content" is set to "Test QA" + """ + { + "prf_content": "Test QA" + } + """ + And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid_" + And I request "project/1265557095225ff5c688f46031700471/file-manager" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And that "prf_filename" is set to "TestQA.html" + And that "prf_content" is set to "Test QA" - Examples: - | prf_ filename | prf_content | prf_number | - | TestQA.html | Test QA - cuando se realiza la sobreescritura desde upload | 7 | + Examples: + | prf_ filename | prf_content | prf_number | + | TestQA.html | Test QA - cuando se realiza la sobreescritura desde upload | 7 | - Scenario Outline: Download files - Given I request "project/1265557095225ff5c688f46031700471/file-manager/prf_uid/download" with the key "prf_uid" stored in session array as variable "prf_uid_" - Then the response status code should be 200 +Scenario Outline: Download files + Given I request "project/1265557095225ff5c688f46031700471/file-manager/prf_uid/download" with the key "prf_uid" stored in session array as variable "prf_uid_" + Then the response status code should be 200 - Examples: - | test_description | prf_number | - | Download file | 0 | - | Download file | 1 | - | Download file | 2 | - | Download file | 4 | + Examples: + | test_description | prf_number | + | Download file | 0 | + | Download file | 1 | + | Download file | 2 | + | Download file | 4 | - Scenario Outline: Delete file +Scenario Outline: Delete file Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid_" And I request "project/1265557095225ff5c688f46031700471/file-manager" - - Then the response status code should be 200 - And the response charset is "UTF-8" + Then the response status code should be 200 + And the response charset is "UTF-8" - Examples: - | test_description | prf_number | - | delete public folder | 0 | - | delete mailtemplates folder | 1 | - | delete public subfolder | 2 | - | delete mailtemplates subfolder | 3 | - | delete mailtemplates subfolder | 4 | - | delete mailtemplates subfolder | 5 | - | delete mailtemplates subfolder | 6 | + Examples: + | test_description | prf_number | + | delete public folder | 0 | + | delete mailtemplates folder | 1 | + | delete public subfolder | 2 | + | delete mailtemplates subfolder | 3 | + | delete mailtemplates subfolder | 4 | + | delete mailtemplates subfolder | 5 | + | delete mailtemplates subfolder | 6 | - Scenario Outline: Delete folder +Scenario Outline: Delete folder Given that I want to delete the folder And I request "project/1265557095225ff5c688f46031700471/file-manager/folder?path=" Then the response status code should be 200 And the response charset is "UTF-8" - Examples: - | test_description | prf_path | - | delete public sub folder | templates/templates_subfolder | - | delete templates sub folder | public/public_subfolder | + Examples: + | test_description | prf_path | + | delete public sub folder | templates/templates_subfolder | + | delete templates sub folder | public/public_subfolder | + + +#BUG 15207, The "Upload" accepts files with other extensions +# +#Scenario Outline: Upload files to same folders "Project - Process Complete BPMN" +# Given POST I want to upload the file "" to path "". Url "project/1455892245368ebeb11c1a5001393784/file-manager" +# And store "prf_uid" in session array as variable "prf_uid_" +# And the response status message should have the following text "incorrect extension" +# +# Examples: +# | file | prf_path | prf_number | +# |/home/wendy/uploadfiles/SnagIt823.exe | templates | 1 | \ No newline at end of file diff --git a/features/backend/projects/process_permissions/main_tests_permissions.feature b/features/backend/projects/process_permissions/main_tests_permissions.feature index aadcc7726..51e74102b 100644 --- a/features/backend/projects/process_permissions/main_tests_permissions.feature +++ b/features/backend/projects/process_permissions/main_tests_permissions.feature @@ -249,22 +249,22 @@ Feature: Process Permissions Resources Tests And the response has 1 record Scenario Outline: Create a new Process permission in proyect "Process Complete BPMN" - Given POST this data: - """ - { - "op_case_status": "", - "tas_uid": "", - "op_user_relation": "", - "usr_uid": "", - "op_task_source" : "", - "op_participate": "", - "op_obj_type": "", - "dynaforms" : "", - "inputs" : "", - "outputs" : "", - "op_action": "" - } - """ + Given POST this data: + """ + { + "op_case_status": "", + "tas_uid": "", + "op_user_relation": "", + "usr_uid": "", + "op_task_source" : "", + "op_participate": "", + "op_obj_type": "", + "dynaforms" : "", + "inputs" : "", + "outputs" : "", + "op_action": "" + } + """ And I request "project/1455892245368ebeb11c1a5001393784/process-permission" Then the response status code should be 201 And store "op_uid" in session array @@ -276,15 +276,17 @@ Scenario Outline: Create a new Process permission in proyect "Process Complete B | op_number | op_case_status | tas_uid | op_user_relation| usr_uid | op_task_source | op_participate | op_obj_type | dynaforms | inputs | outputs | op_action | | 1 | COMPLETED | | 1 | 00000000000000000000000000000001 | | 0 | MSGS_HISTORY | | | | RESEND | + | 2 | COMPLETED | | 1 | 00000000000000000000000000000001 | | 0 | MSGS_HISTORY | | | | RESEND | - Scenario: Get a List of current Process Permissions of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" + +Scenario: Get a List of current Process Permissions of a project + Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" Then the response status code should be 200 And the response charset is "UTF-8" - And the response has 2 record + And the response has 3 record Scenario Outline: Delete all Process Supervisor created previously in this script - Given that I want to delete a resource with the key "op_uid" stored in session array as variable "op_uid_" + Given that I want to delete a resource with the key "op_uid" stored in session array as variable "op_uid_" And I request "project/1455892245368ebeb11c1a5001393784/process-permission" And the content type is "application/json" Then the response status code should be 200 @@ -293,11 +295,12 @@ Scenario Outline: Delete all Process Supervisor created previously in this scrip Examples: - | op_number | - | 1 | + | op_number | + | 1 | + | 2 | Scenario: Get a List of current Process Permissions of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" + Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" Then the response status code should be 200 And the response charset is "UTF-8" And the response has 1 record \ No newline at end of file