Merged in wnestor/processmaker (pull request #378)

Avance de los features category, cases actions, case note, output document cases, input document
This commit is contained in:
Erik Amaru Ortiz
2014-04-08 09:28:30 -04:00
11 changed files with 318 additions and 47 deletions

View File

@@ -0,0 +1,72 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process Category
Requirements:
a workspace with the workspace with one process category
Background:
Given that I have a valid access_token
Scenario: Get list of Categories
Given I request "categories"
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: Get a Category specific
Given I request "category/4177095085330818c324501061677193"
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: Create a new Categories
Given POST this data:
"""
{
"cat_name": "Test new Category"
}
"""
And I request "category"
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 store "cat_uid" in session array as variable "cat_uid"
Scenario: Get list of Categories
Given I request "categories"
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: Update the Category created in this script
Given PUT this data:
"""
{
"cat_name": "Name Updated"
}
"""
And that I want to update a resource with the key "cat_uid" stored in session array
And I request "category"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Scenario: Delete the Category created previously in this script
Given that I want to delete a resource with the key "cat_uid" stored in session array
And I request "category"
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"

View File

@@ -0,0 +1,139 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process Category Main Test
Requirements:
a workspace with the workspace with one process category
Background:
Given that I have a valid access_token
Scenario: Get list of Categories
Given I request "categories"
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: Get a Category specific
Given I request "category/4177095085330818c324501061677193"
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 "cat_uid" property equals "4177095085330818c324501061677193"
And the "cat_name" property equals "Category Cases Lists"
And the "cat_total_processes" property equals 5
Scenario Outline: Create a new Categories
Given POST this data:
"""
{
"cat_name": "<cat_name>"
}
"""
And I request "category"
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 store "cat_uid" in session array as variable "cat_uid_<cat_uid_number>"
Examples:
| test_description | cat_uid_number | cat_name |
| Create new Category with character special | 1 | sample!@#$%^^& |
| Create new Category with only character numeric | 2 | 32425325 |
| Create new Category with only character special | 3 | @$@$#@% |
| Create new Category with normal character | 4 | sample |
Scenario: Get list of Categories
Given I request "categories"
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 5 records
Scenario: Create Category with same name
Given POST this data:
"""
{
"cat_name": "sample"
}
"""
And I request "category"
Then the response status code should be 400
And the response status message should have the following text "Duplicate"
Scenario Outline: Update the Category created in this script
Given PUT this data:
"""
{
"cat_name": "cat_name"
}
"""
And I request "category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>"
And store "cat_uid" in session array as variable "cat_uid_<cat_uid_number>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| test_description | cat_uid_number | cat_name |
| Update Category | 1 | UPDATE sample!@#$%^^& |
| Update Category | 2 | UPDATE 32425325 |
Scenario Outline: Get a Category specific
Given I request "category/4177095085330818c324501061677193"
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 "cat_name" property equals "UPDATE sample!@#$%^^&"
And the "cat_total_processes" property equals 0
Examples:
| cat_uid_number | cat_name | cat_total_processes |
| 1 | UPDATE sample!@#$%^^& | 0 |
| 2 | UPDATE 32425325 | 0 |
Scenario Outline: Delete the Category created previously in this script
Given that I want to delete a resource with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>"
And I request "category"
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:
| cat_uid_number |
| 1 |
| 2 |
| 3 |
| 4 |
Scenario: Get a Category specific
Given I request "category/4177095085330818c324501061677193"
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 "cat_uid" property equals "4177095085330818c324501061677193"
And the "cat_name" property equals "Category Cases Lists"
And the "cat_total_processes" property equals 5

View File

@@ -0,0 +1,23 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process Category Negative Tests
Background:
Given that I have a valid access_token
Scenario Outline: Create a new Categories (Negative Test)
Given POST this data:
"""
{
"cat_name": "<cat_name>"
}
"""
And I request "category"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
| test_description | cat_name | error_code | error_message |
| without name | | 400 | cat_name |

View File

@@ -22,9 +22,9 @@ Scenario Outline: Create a new case (Negative Test)
Examples:
| Description | pro_uid | tas_uid | error_code | error_message |
| Create new case with pro_uid wrong | 99209594750ec1111111927000421575 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
| Create new case with task_uid wrong | 46279907250ec73b9b25a78031279680 | 99371337811111111111116024620271 | 400 | task_uid |
| Create new case with tas_uid wrong | 46279907250ec73b9b25a78031279680 | 99371337811111111111116024620271 | 400 | tas_uid |
| Create new case without pro_uid | | 52838134750ec7dd0989fc0015625952 | 400 | pro_uid |
| Create new case without tas_uid | 34579467750ec8d55e8b115057818502 | | 400 | task_uid |
| Create new case without tas_uid | 34579467750ec8d55e8b115057818502 | | 400 | tas_uid |
| Create new case whith pro_uid and tas_uid wrong | 8245849601111111181ecc7039804404 | 5690001111111118e4a9243080698854 | 400 | pro_uid |
@@ -34,9 +34,9 @@ Scenario Outline: Create a new case Impersonate (Negative Test)
Given POST this data:
"""
{
"pro_uid": "99209594750ec27ea338927000421575",
"pro_uid": "<pro_uid>",
"usr_uid": "<usr_uid>",
"tas_uid": "68707275350ec281ada1c95068712556",
"tas_uid": "<tas_uid>",
"variables": [{"name": "pruebaQA", "amount":"10400"}]
}
"""
@@ -45,12 +45,12 @@ Scenario Outline: Create a new case Impersonate (Negative Test)
And the response status message should have the following text "<error_message>"
Examples:
| Description | case_number | usr_uid | error_code | error_message |
| Create new case with process "Derivation rules - sequential" - Case Start with chris | 26 | 51049032352d56710347233042615067 | 400 | pro_uid |
| Create new case with process "Derivation rules - evaluation" - Case Start with adam | 27 | 44811996752d567110634a1013636964 | 400 | task_uid |
| Create new case with process "Derivation rules - Parallel" - Case Start with aaron | 28 | 24166330352d56730cdd525035621101 | 400 | pro_uid |
| Create new case with process "Derivation rules - parallel evaluation"- Case Start with jeremiah | 29 | 86677227852d5671f40ba25017213081 | 400 | task_uid |
| Create new case with process "Derivation rules - selection" - Case Start with admin | 30 | 62625000752d5672d6661e6072881167 | 400 | |
| Description | pro_uid | usr_uid | tas_uid | error_code | error_message |
| Create new case with process "Derivation rules - sequential" invalid pro_uid | 99201111111111111138927000421575 | 51049032352d56710347233042615067 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
| Create new case with process "Derivation rules - evaluation" invalid tas_uid | 99209594750ec27ea338927000421575 | 44811996752d567110634a1013636964 | 68707211111111111111111111712556 | 400 | tas_uid |
| Create new case with process "Derivation rules - Parallel" usr_uid | 99209594750ec27ea338927000421575 | 24166331111111111111115035621101 | 68707275350ec281ada1c95068712556 | 400 | usr_uid |
| Create new case with process "Derivation rules - without pro_uid | | 86677227852d5671f40ba25017213081 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
| Create new case with process "Derivation rules - selection" tas_uid | 99209594750ec27ea338927000421575 | 62625000752d5672d6661e6072881167 | | 400 | tas_uid |
Scenario Outline: Create a case, derivate and cancel. then try do pause or route
@@ -66,6 +66,7 @@ Scenario Outline: Create a case, derivate and cancel. then try do pause or route
And I request "cases"
Then the response status code should be 200
And store "app_uid" in session array as variable "app_uid_<case_number>"
#Send some variables
And PUT this data:
"""
@@ -115,9 +116,22 @@ Scenario Outline: Create a case, derivate and cancel. then try do pause or route
And I request "cases/app_uid/pause" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
Then the response status code should be 400
And the response status message should have the following text "<error_message_pause>"
And PUT this data:
"""
{
}
"""
And that I want to delete a resource with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
And I request "cases"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
Examples:
| Description | case_number | pro_uid | tas_uid | error_message_route | error_message_pause |
| Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | This case delegation is already closed | This case delegation is already closed |
| Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | This case delegation is already closed | This case delegation is already closed |

View File

@@ -9,7 +9,6 @@ Background:
Scenario: List of case notes for this case
Given I request "cases/1185553665335d2e209f723099733152/notes"
the response time should at least be (\d+) milliseconds$/
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
@@ -36,4 +35,11 @@ Scenario: Create a new case note for specified case
And the content type is "application/json"
And the type is "object"
Scenario: List of case notes for this case
Given I request "cases/1185553665335d2e209f723099733152/notes"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
#case 125

View File

@@ -12,18 +12,46 @@ Scenario: List of case notes for this case
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the "note_content" property in row 0 equals "tercer case note creado desde script"
Scenario: Create a new case note for specified case
Given POST this data:
"""
{
"note_content": "tercer case note creado desde script",
"send_email": 1
}
"""
And I request "case/1185553665335d2e209f723099733152/case"
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"
Scenario: Get a List of cases notes of a case with paged
Given I request "cases/1185553665335d2e209f723099733152/notes/paged"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
Scenario Outline: Create a new case note for specified case
Given POST this data:
"""
{
"note_content": "<note_content>",
"send_email": <send_email>
}
"""
And I request "cases/1185553665335d2e209f723099733152/note"
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 | note_content | send_email |
| Create case note with charater special | Test!@#$ %^&*£ | 1 |
| Create case note with 150 chacarters | Este es una prueba con varios caracteres 112334@#$Este es una prueba con varios caracteres 112334@#$Este es una prueba con varios caracteres 112334@#$ | 1 |
| Create case note with character without space | Estaesunapruebasinespaciosentrepalabraslamismadebeseraceptado | 1 |
| Create case note without send mail | Test sin envio de email | 0 |
| Create case normal with character normal | tercer case note creado desde script | 1 |
Scenario: List of case notes for this case
Given I request "cases/1185553665335d2e209f723099733152/notes"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the "note_content" property in row 0 equals "tercer case note creado desde script"
And the "note_content" property in row 1 equals "Test sin envio de email"

View File

@@ -20,8 +20,5 @@ Scenario: create a new case note for specified case (Negative Tests)
Then the response status code should be 400
And the response status message should have the following text "You do not have permission to cases notes"
#case 124

View File

@@ -13,11 +13,11 @@ Scenario: Returns a list of the uploaded documents for a given case
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 5 records
And the response has 9 records
Scenario: Returns an uploaded documents for a given case
Given I request "cases/170220159534214f642abb8058832933/input-document/6075490825331a1c5eebff9015468244"
Given I request "cases/170220159534214f642abb8058832933/input-document/925833635534215b9148a64026212674"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"

View File

@@ -40,19 +40,11 @@ Scenario Outline: Post metadata and then upload documents for a given case
| 4 | /home/wendy/uploadfiles/test.txt | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
Scenario Outline: Returns an uploaded documents for a given case
Given I request "cases/<case_uid>/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
Given I request "cases/<case_uid>/input-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "app_doc_uid" property equals "<app_doc_uid>"
And the "app_doc_filename" property equals "<app_doc_filename>"
And the "doc_uid" property equals "<doc_uid>"
And the "app_doc_version" property equals "<app_doc_version>"
And the "app_doc_create_date" property equals "<app_doc_create_date>"
And the "app_doc_create_user" property equals "<app_doc_create_user>"
And the "app_doc_type" property equals "<app_doc_type>"
And the "app_doc_index" property equals "<app_doc_index>"
And the "app_doc_link" property equals "<app_doc_link>"
Examples:

View File

@@ -9,7 +9,7 @@ Background:
Scenario: Returns a list of the uploaded documents for a given case
Given I request "cases/170220159534214f642abb8058832000/input-documents"
Given I request "cases/170220159534214f642abb8058832900/input-documents"
Then the response status code should be 404
Scenario Outline: Post metadata and then upload documents for a given case

View File

@@ -13,14 +13,14 @@ Scenario: Returns a list of the generated documents for a given cases
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 6 records
And the response has 1 records
Scenario: Returns an generated document for a given case
Given I request "cases/33125846153383cecdf64f1079330191/output-document/3000248055333006ab56a01005891659"
Given I request "cases/33125846153383cecdf64f1079330191/output-document/75468909953383d0bc42f96046736849"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "Object"
And the type is "object"
Scenario: Generate or regenerates an output documents for a given case