2014-02-13 14:56:52 -04:00
|
|
|
@ProcessMakerMichelangelo @RestAPI
|
|
|
|
|
Feature: Files Manager Resources
|
|
|
|
|
|
|
|
|
|
Background:
|
|
|
|
|
Given that I have a valid access_token
|
|
|
|
|
|
|
|
|
|
Scenario: Get a list of main process files manager
|
2014-02-20 12:27:28 -04:00
|
|
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager"
|
2014-02-13 14:56:52 -04:00
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
Scenario: Get a list public folder of process files manager
|
2014-02-20 12:27:28 -04:00
|
|
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=public"
|
2014-02-13 14:56:52 -04:00
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
Scenario: Get a list templates folder of process files manager
|
2014-02-20 12:27:28 -04:00
|
|
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates"
|
2014-02-13 14:56:52 -04:00
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
Scenario Outline: Post files
|
|
|
|
|
Given POST this data:
|
|
|
|
|
"""
|
|
|
|
|
{
|
2014-02-20 13:01:30 -04:00
|
|
|
"prf_filename": "<file_name>",
|
|
|
|
|
"prf_path": "<path>",
|
|
|
|
|
"prf_content": "<content>"
|
2014-02-13 14:56:52 -04:00
|
|
|
}
|
|
|
|
|
"""
|
2014-02-20 12:27:28 -04:00
|
|
|
And I request "project/1265557095225ff5c688f46031700471/file-manager"
|
2014-02-21 09:00:17 -04:00
|
|
|
Then the response status code should be <http_code>
|
2014-02-13 14:56:52 -04:00
|
|
|
And the response charset is "UTF-8"
|
|
|
|
|
And the content type is "application/json"
|
|
|
|
|
And the type is "<type>"
|
|
|
|
|
And store "prf_uid" in session array as variable "prf_uid<i>"
|
|
|
|
|
|
|
|
|
|
Examples:
|
2014-02-26 12:22:22 -04:00
|
|
|
| test_description | file_name | path | content | http_code | type | i |
|
|
|
|
|
| into public folder | testbehat.txt | public/ | test | 200 | object | 0 |
|
|
|
|
|
| into mailtemplates folder | testbehat.txt | templates/ | test | 200 | object | 1 |
|
|
|
|
|
| into public subfolder | testbehat.txt | public/test_folder | test | 200 | object | 2 |
|
|
|
|
|
| into mailtemplates subfolder | testbehat.txt | templates/test_folder | test | 200 | object | 3 |
|
2014-02-13 14:56:52 -04:00
|
|
|
|
|
|
|
|
Scenario Outline: Post files
|
|
|
|
|
Given PUT this data:
|
|
|
|
|
"""
|
|
|
|
|
{
|
2014-02-20 13:01:30 -04:00
|
|
|
"prf_content": "<content>"
|
2014-02-13 14:56:52 -04:00
|
|
|
}
|
|
|
|
|
"""
|
2014-02-26 12:22:22 -04:00
|
|
|
And that I want to update a resource with the key "prf_uid" stored in session array as variable "prf_uid<i>"
|
|
|
|
|
And I request "project/1265557095225ff5c688f46031700471/file-manager"
|
2014-02-21 09:00:17 -04:00
|
|
|
Then the response status code should be <http_code>
|
2014-02-13 14:56:52 -04:00
|
|
|
And the response charset is "UTF-8"
|
|
|
|
|
And the content type is "application/json"
|
|
|
|
|
And the type is "<type>"
|
|
|
|
|
|
|
|
|
|
Examples:
|
2014-02-26 12:22:22 -04:00
|
|
|
| test_description | content | http_code | type | i |
|
|
|
|
|
| put into public folder | put test | 200 | object | 0 |
|
|
|
|
|
| put into mailtemplates folder | put test | 200 | object | 1 |
|
|
|
|
|
| put into public subfolder | put test | 200 | object | 2 |
|
|
|
|
|
| put into mailtemplates subfolder | put test | 200 | object | 3 |
|
2014-02-21 09:00:17 -04:00
|
|
|
|
2014-02-20 13:01:30 -04:00
|
|
|
Scenario Outline: Delete file
|
2014-02-26 12:22:22 -04:00
|
|
|
Given that I want to delete a resource with the key "prf_uid" stored in session array as variable "prf_uid<i>"
|
|
|
|
|
And I request "project/1265557095225ff5c688f46031700471/file-manager"
|
2014-02-13 14:56:52 -04:00
|
|
|
Then the response status code should be 200
|
|
|
|
|
And the response charset is "UTF-8"
|
|
|
|
|
|
|
|
|
|
Examples:
|
2014-02-26 12:22:22 -04:00
|
|
|
| test_description | i |
|
|
|
|
|
| delete public folder | 0 |
|
|
|
|
|
| delete mailtemplates folder | 1 |
|
|
|
|
|
| delete public subfolder | 2 |
|
|
|
|
|
| delete mailtemplates subfolder | 3 |
|
2014-02-21 09:00:17 -04:00
|
|
|
|
|
|
|
|
#Para que funcione este test, debe existir el archivo que se quiere subir
|
|
|
|
|
Scenario: Post files
|
2014-02-26 12:22:22 -04:00
|
|
|
Given POST I want to upload the file "/home/daniel/test.txt" to path "templates". Url "project/1265557095225ff5c688f46031700471/file-manager"
|
2014-02-21 09:00:17 -04:00
|
|
|
|
|
|
|
|
Scenario: Delete file
|
2014-02-26 12:22:22 -04:00
|
|
|
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"
|
2014-02-21 09:00:17 -04:00
|
|
|
Then the response status code should be 200
|
|
|
|
|
And the response charset is "UTF-8"
|