Merged in wnestor/processmaker (pull request #279)

Modificaciones a los features file manager, process variables y trigger wizard
This commit is contained in:
erik ao
2014-03-07 13:15:17 -04:00
7 changed files with 319 additions and 68 deletions

View File

@@ -121,7 +121,6 @@ Feature: Activity Resources Main Tests
And the property "tas_assign_type" of "properties" is set to "<tas_assign_type>"
And the property "tas_assign_variable" of "properties" is set to "<tas_assign_variable>"
And the property "tas_group_variable" of "properties" is set to "<tas_group_variable>"
And the property "tas_selfservice_timeout" of "properties" is set to <tas_selfservice_timeout>
And the property "tas_selfservice_time" of "properties" is set to "<tas_selfservice_time>"
And the property "tas_selfservice_time_unit" of "properties" is set to "<tas_selfservice_time_unit>"
And the property "tas_transfer_fly" of "properties" is set to "<tas_transfer_fly>"

View File

@@ -31,7 +31,7 @@ Feature: Files Manager Resources Main Tests
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 2 records
Scenario Outline: Create files and subfolders
Given POST this data:
@@ -99,12 +99,12 @@ Feature: Files Manager Resources Main Tests
And the content type is "application/json"
And the type is "<type>"
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 | <h1>Test</h1><p>html test</p><i>modified</i> | 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 |
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 | <h1>Test</h1><p>html test</p><i>modified</i> | 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
@@ -117,46 +117,67 @@ Feature: Files Manager Resources Main Tests
And the "prf_path" property in row <row> equals "<prf_path>"
And the "prf_content" property in row <row> equals "<prf_content>"
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 | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 | 1 | templates/ |
| put into public subfolder | file_test_3.txt | put test | 200 | object | 2 | 0 | public/public_subfolder |
| put into mailtemplates subfolder | file_test_4.html | put test | 200 | object | 3 | 0 | templates/templates_subfolder |
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 | <h1>Test</h1><p>html test</p><i>modified</i> | 200 | object | 1 | 1 | templates/ |
| put into public subfolder | file_test_3.txt | put test | 200 | object | 2 | 0 | public/public_subfolder |
| put into mailtemplates subfolder | file_test_4.html | put test | 200 | object | 3 | 0 | templates/templates_subfolder |
Scenario Outline: Upload files to same folders
Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1265557095225ff5c688f46031700471/file-manager"
And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
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 |
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 |
Scenario: Upload files when the file already exists
Given POST I want to upload the file "/home/wendy/uploadfiles/alert_message.html" to path "templates". Url "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: Upload files when the file already exists in the folder but with different content. must overwrite
Given POST I want to upload the file "/home/wendy/uploadfiles/TestQA.html" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager"
Then the response status code should be 200
Scenario: Get a single Files Manager and check some properties the overwritten file
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 "prf_filename" property in row 4 equals "TestQA.html"
And the "prf_content" property in row 4 equals "Test QA - cuando se realiza la sobreescritura desde upload"
Scenario: 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
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"
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_<prf_number>"
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 | 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
@@ -166,25 +187,24 @@ Feature: Files Manager Resources Main Tests
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
Given that I want to delete the folder
And I request "project/1265557095225ff5c688f46031700471/file-manager/folder?path=<prf_path>"
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_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 |

View File

@@ -36,13 +36,4 @@ Feature: File Manager Negative Tests
| Invalid path template | 1265557095225ff5c688f46031700471 | file_test_2.html | temptes_manager/ | <h1>Test</h1><p>html test</p> | 400 | prf_path |
| Field Required prf_filename in public | 1265557095225ff5c688f46031700471 | | public/ | only text | 400 | prf_filename |
| Field Required prf_filename in template | 1265557095225ff5c688f46031700471 | | templates/ | <h1>Test</h1><p>html test</p> | 400 | prf_filename |
| Field Required project | | file_test_1.txt | public/ | only text | 400 | prj_uid |
# how to get content if a file - revisar si hay el endpoint para poner el contenido del html
# how to delete sub folders
# upload big files -
# actualizar el conteniudo subiendo un archivo nuevo con el mismo nombre...
| Field Required project | | file_test_1.txt | public/ | only text | 400 | prj_uid |

View File

@@ -0,0 +1,85 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process Variables Main Tests
Requirements:
a workspace with the process 3306142435318cd22d1eba2015305561 ("Process variables") already loaded
there are three activities in the process
Background:
Given that I have a valid access_token
Scenario Outline: Get all variables of a Process
And I request "project/3306142435318cd22d1eba2015305561/variables"
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 "var_name" property in row <i> equals "<var_name>"
Examples:
| i | var_name |
| 0 | SYS_LANG |
| 1 | SYS_SKIN |
| 2 | SYS_SYS |
| 3 | APPLICATION |
| 4 | PROCESS |
| 5 | TASK |
| 6 | INDEX |
| 7 | USER_LOGGED |
| 8 | USR_USERNAME |
| 9 | PIN |
| 10 | grilla2 |
| 11 | grilla3 |
| 12 | grilla1 |
Scenario: Get grid variables of a Process
Given I request "project/3306142435318cd22d1eba2015305561/grid/variables"
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 3 records
And the "var_name" property in row 0 equals "grilla2"
And the "var_name" property in row 1 equals "grilla3"
And the "var_name" property in row 2 equals "grilla1"
Scenario: Get all variables of a Grid
Given I request "project/3306142435318cd22d1eba2015305561/grid/8246998615318cd7cc451d2089449499/variables"
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 that "var_name" is set to "fecha"
And that "var_label" is set to "Date Static Date Y/m/d 24/07-31/07"
And that "var_type" is set to "date"
And that "var_name" is set to "text"
And that "var_label" is set to "Text Field + Validate Any"
And that "var_type" is set to "text"
And that "var_name" is set to "currency"
And that "var_label" is set to "Currency Fields Real Number ###,###,###,###.##"
And that "var_type" is set to "currency"
And that "var_name" is set to "porcentage"
And that "var_label" is set to "Porcentage Field + Real Number ###.## %"
And that "var_type" is set to "percentage"
And that "var_name" is set to "textarea"
And that "var_label" is set to "Text area Field"
And that "var_type" is set to "textarea"
And that "var_name" is set to "dropdown"
And that "var_label" is set to "Dropdown Field"
And that "var_type" is set to "dropdown"
And that "var_name" is set to "yesno"
And that "var_label" is set to "Yes/No Field"
And that "var_type" is set to "yesno"
And that "var_name" is set to "checkbox"
And that "var_label" is set to "Check Box Field"
And that "var_type" is set to "checkbox"
And that "var_name" is set to "suggest1"
And that "var_label" is set to "Suggest Usuarios"
And that "var_type" is set to "suggest"
And that "var_name" is set to "link"
And that "var_label" is set to "Link Field"
And that "var_type" is set to "link"
And that "var_name" is set to "addfile"
And that "var_label" is set to "Add File Field"
And that "var_type" is set to "file"

View File

@@ -0,0 +1,33 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process Variables Negative Tests
Background:
Given that I have a valid access_token
Scenario: Get all variables of a Process bad parameters (negative tests)
And I request "project/3306142435318cd22d1eba2015305561/variables"
Then the response status code should be 400
Scenario Outline: Get all variables of a Grid bad parameters (negative tests)
Given I request "project/14414793652a5d718b65590036026581/grid/00000000000000000000000000000000/variables"
And the content type is "application/json"
Then the response status code should be <status_code>
And the response charset is "UTF-8"
And the type is "object"
And the response status message should have the following text "<status_message>"
Examples:
| status_code | status_message |
| 400 | grid_uid |
Scenario: Get all variables of a Grid bad parameters (negative tests)
Given I request "project/3306142435318cd22d1eba2015305561/grid/8246998615318cd7cc451d2089449499/variables"
And that "var_name" is set to "desarrollo"
Then the response status code should be 400
And the response status message should have the following text "var_name"

View File

@@ -8,7 +8,7 @@ Feature: Group
Given that I have a valid access_token
Scenario Outline: Get the Trigger Wizards List when there are exactly 6 library
Scenario Outline: Get the Trigger Wizard List when there are exactly 6 library
And I request "project/14414793652a5d718b65590036026581/trigger-wizards"
And the content type is "application/json"
Then the response status code should be 200
@@ -22,8 +22,13 @@ Feature: Group
Examples:
| i | lib_name | lib_title | lib_class_name |
| 0 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php |
| 1 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
| 2 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
| 1 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php |
| 2 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php |
| 3 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php |
| 4 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
| 5 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
Scenario Outline: Get a single Library
@@ -65,6 +70,7 @@ Feature: Group
| pmSugar | CreateSugarAccount | Creates SugarCRM entries from the Account module |
Scenario: Get a List of triggers of a project
And I request "project/14414793652a5d718b65590036026581/triggers"
And the content type is "application/json"
@@ -74,7 +80,7 @@ Feature: Group
And the json data is an empty array
Scenario Outline: Create new Trigger
Scenario Outline: Create new Trigger: PMFAddAttachmentToArray
Given POST this data:
"""
{
@@ -104,8 +110,42 @@ Feature: Group
Examples:
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.arrayData | tri_params.input.index | tri_params.input.value | tri_params.input.suffix | tri_params.output.tri_answer |
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger | | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta |
| 1 | pmFunctions | PMFSendMessage | My trigger 1 | Envio de email | SCRIPT |
Scenario Outline: Create new Trigger: createDWS
Given POST this data:
"""
{
"tri_title": "<tri_title>",
"tri_description": "<tri_description>",
"tri_type": "<tri_type>",
"tri_params": {
"input": {
"sharepointServer": "<tri_params.input.sharepointServer>",
"auth": "<tri_params.input.auth>",
"name": "<tri_params.input.name>",
"users": "<tri_params.input.users>",
"title": "<tri_params.input.title>",
"documents": "<tri_params.input.documents>"
},
"output": {
"tri_answer": "<tri_params.output.tri_answer>"
}
}
}
"""
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
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 "tri_uid" in session array as variable "tri_uid<i>"
Examples:
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.sharepointServer | tri_params.input.auth | tri_params.input.name | tri_params.input.users | tri_params.input.title | tri_params.input.documents | tri_params.output.tri_answer |
| 1 | pmTrSharepoint | createDWS | Sharepoint 1 | | SCRIPT | @@SERVER | username:password | Test DWS | @@users | Test DWS | /files/test.doc | $respuesta |
Scenario Outline: Update Trigger
Given PUT this data:
@@ -138,6 +178,42 @@ Feature: Group
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.arrayData | tri_params.input.index | tri_params.input.value | tri_params.input.suffix | tri_params.output.tri_answer |
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT | array(1, 2, 3, 4) | 1 | 2 | My Copy2({i}) | $r |
Scenario Outline: Create new Trigger: createDWS
Given PUT this data:
"""
{
"tri_title": "<tri_title>",
"tri_description": "<tri_description>",
"tri_type": "<tri_type>",
"tri_params": {
"input": {
"sharepointServer": "<tri_params.input.sharepointServer>",
"auth": "<tri_params.input.auth>",
"name": "<tri_params.input.name>",
"users": "<tri_params.input.users>",
"title": "<tri_params.input.title>",
"documents": "<tri_params.input.documents>"
},
"output": {
"tri_answer": "<tri_params.output.tri_answer>"
}
}
}
"""
And that I want to update a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
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:
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.sharepointServer | tri_params.input.auth | tri_params.input.name | tri_params.input.users | tri_params.input.title | tri_params.input.documents | tri_params.output.tri_answer |
| 1 | pmTrSharepoint | createDWS | Sharepoint 1 - Modified | | SCRIPT | @@SERVER_URL | username:password | Test DWS | @@users | Test DWS | /files/test.doc | $respuesta |
Scenario Outline: Get a Trigger that was created with the wizard
Given that I want to get a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
@@ -151,8 +227,9 @@ Feature: Group
And that "tri_type" is set to "<tri_type>"
Examples:
| i | lib_name | fn_name | tri_title | tri_description | tri_type |
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT |
| i | lib_name | fn_name | tri_title | tri_description | tri_type |
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT |
| 1 | pmTrSharepoint | createDWS | Test DWS | | SCRIPT |
Scenario Outline: Delete a trigger of a project
@@ -166,6 +243,7 @@ Feature: Group
Examples:
| i |
| 0 |
| 1 |
Scenario: Get a List of triggers of a project

View File

@@ -5,4 +5,49 @@ Feature: Triggers Wizard Negative Tests
Background:
Given that I have a valid access_token
Scenario: Get a single Library with bad parameters (negative tests)
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/sampleqa"
Then the response status code should be 400
And the response status message should have the following text "not exist"
Scenario: Get a single Function of the Library with bad parameters (negative tests)
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/qadesarrollo/funcionexterna"
Then the response status code should be 400
And the response status message should have the following text "not exist"
Scenario Outline: Create new Trigger with bad parameters (negative tests)
Given POST this data:
"""
{
"tri_title": "<tri_title>",
"tri_description": "<tri_description>",
"tri_type": "<tri_type>",
"tri_params": {
"input": {
"arrayData": "<tri_params.input.arrayData>",
"index": "<tri_params.input.index>",
"value": "<tri_params.input.value>",
"suffix": "<tri_params.input.suffix>"
},
"output": {
"tri_answer": "<tri_params.output.tri_answer>"
}
}
}
"""
And I request "project/<project>/trigger-wizard/<lib_name>/<fn_name>"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
| test_description | project | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.arrayData | tri_params.input.index | tri_params.input.value | tri_params.input.suffix | tri_params.output.tri_answer | error_code | error_message |
| Field required project | | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | prj_uid |
| Field required tri_title | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_title |
| Field required tri_type | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_type |
| Field required tri_params input | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | | | | | $respuesta | 400 | tri_params |
| Field required tri_params output | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | | 400 | tri_params |
| Invalid lib_name | 14414793652a5d718b65590036026581 | processmakerfunction | PMFAddAttachmentToArray | My trigger | sample | SCRIPT | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | lib_name |
| Invalid tri_type | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | My trigger | sample | sample | array(1, 2) | 1 | 2 | My Copy({i}) | $respuesta | 400 | tri_type |