Merged in wnestor/processmaker (pull request #340)

Avance de los features Cases Lists, Input Document Case, Output Document Case y creacion de una nueva funcion para contar la cantidad de casos en las listas
This commit is contained in:
erik ao
2014-03-27 12:50:53 -04:00
7 changed files with 519 additions and 235 deletions

View File

@@ -12,8 +12,7 @@ Scenario: Returns a list of the cases for the logged in user (Inbox)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get paging of list inbox Scenario: Get paging of list inbox
Given I request "cases/paged" Given I request "cases/paged"
@@ -21,8 +20,7 @@ Scenario: Get paging of list inbox
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases?dir=DESC" Given I request "cases?dir=DESC"
@@ -69,8 +67,7 @@ Scenario: Returns a list of the cases for the logged in user (Draft)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get paging of list Draft Scenario: Get paging of list Draft
Given I request "cases/draft/paged" Given I request "cases/draft/paged"
@@ -78,8 +75,7 @@ Scenario: Get paging of list Draft
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases/draft?dir=DESC" Given I request "cases/draft?dir=DESC"
@@ -126,8 +122,7 @@ Scenario: Returns a list of the cases for the logged in user (Participated)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 6 records
Scenario: Get paging of list Participated Scenario: Get paging of list Participated
Given I request "cases/participated/paged" Given I request "cases/participated/paged"
@@ -135,8 +130,7 @@ Scenario: Get paging of list Participated
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases/participated?dir=DESC" Given I request "cases/participated?dir=DESC"
@@ -183,8 +177,7 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get paging of list Unassigned Scenario: Get paging of list Unassigned
Given I request "cases/unassigned/paged" Given I request "cases/unassigned/paged"
@@ -192,8 +185,7 @@ Scenario: Get paging of list Unassigned
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases/unassigned?dir=DESC" Given I request "cases/unassigned?dir=DESC"
@@ -240,8 +232,7 @@ Scenario: Returns a list of the cases for the logged in user (Paused)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get paging of list Paused Scenario: Get paging of list Paused
Given I request "cases/paused/paged" Given I request "cases/paused/paged"
@@ -249,8 +240,7 @@ Scenario: Get paging of list Paused
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases/paused?dir=DESC" Given I request "cases/paused?dir=DESC"
@@ -297,8 +287,7 @@ Scenario: Returns a list of the cases for the logged in user (Advanced Search)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get paging of list Advanced Search Scenario: Get paging of list Advanced Search
Given I request "cases/advanced-search/paged" Given I request "cases/advanced-search/paged"
@@ -306,8 +295,7 @@ Scenario: Get paging of list Advanced Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records
Scenario: Get order type of Descending Scenario: Get order type of Descending
Given I request "cases/advanced-search?dir=DESC" Given I request "cases/advanced-search?dir=DESC"

View File

@@ -7,49 +7,120 @@ Background:
Given that I have a valid access_token Given that I have a valid access_token
#Obtener la cantidad de casos ACTUALES por cada listado
Scenario: Returns a list of the cases for the logged in user (Inbox) Scenario: Returns a list of the cases for the logged in user (Inbox)
Given I request "cases" Given I request "cases"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And store response count in session variable as "count_inbox"
Scenario: Returns a list of the cases for the logged in user (Draft)
Given I request "cases/draft"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And store response count in session variable as "count_draft"
Scenario: Returns a list of the cases for the logged in user (Participated)
Given I request "cases/participated"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And store response count in session variable as "count_participated"
Scenario: Returns a list of the cases for the logged in user (Unassigned)
Given I request "cases/unassigned"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And store response count in session variable as "count_unassigned"
Scenario: Returns a list of the cases for the logged in user (Paused)
Given I request "cases/paused"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And store response count in session variable as "count_paused"
Scenario: Returns a list of the cases for the logged in user (Advanced-Search)
Given I request "cases/paused"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And store response count in session variable as "count_advanced-search"
Scenario Outline: Create a new case in workspace with process "Derivation rules - sequential", "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection"
Given POST this data:
"""
{
"pro_uid": "<pro_uid>",
"tas_uid": "<tas_uid>",
"variables": [{"name": "admin", "lastname":"admin"}]
}
"""
And I request "cases"
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 "app_uid" in session array as variable "app_uid_<app_uid_number>"
And store "app_number" in session array as variable "app_number_<app_uid_number>"
Examples:
| Description | app_uid_number | pro_uid | tas_uid | variables |
| Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | |
| Create new case with process "Derivation rules - evaluation" | 2 | 46279907250ec73b9b25a78031279680 | 99371337850ec73c0a38eb6024620271 | |
| Create new case with process "Derivation rules - Parallel" | 3 | 35894775350ec7daa099378048029617 | 52838134750ec7dd0989fc0015625952 | |
| Create new case with process "Derivation rules - parallel evaluation" | 4 | 34579467750ec8d55e8b115057818502 | 89648437550ec8d593c2159010276089 | |
| Create new case with process "Derivation rules - selection" | 5 | 82458496050ec668981ecc7039804404 | 56900024450ec668e4a9243080698854 | |
#Scenarios para filtros y paginacion de las listas
Scenario Outline: Get paging of list inbox Scenario Outline: Get paging of list inbox
Given I request "cases/paged?Start=<start>&limit=<limit>" Given I request "cases/paged?Start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_inbox>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 5 | 3 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending and Acending Scenario Outline: Get order type of Descending and Acending
@@ -58,13 +129,13 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_inbox>"
Examples: Examples:
| test_description | dir | records | | test_description | dir | records |
| Order for Acending | asc | | | Order for Acending | asc | 1 |
| Order for Descending | desc | | | Order for Descending | desc | 1 |
Scenario Outline: Get order type of Process Category Scenario Outline: Get order type of Process Category
@@ -73,12 +144,12 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_inbox>"
Examples: Examples:
| test_description | cat_uid | records | | test_description | cat_uid | records |
| Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | 1 |
| Filter all categories | | | | Filter all categories | | |
@@ -88,7 +159,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_inbox>"
Examples: Examples:
@@ -103,7 +174,7 @@ Scenario Outline: Get order type of Search of number the process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_inbox>"
Examples: Examples:
@@ -117,7 +188,7 @@ Scenario: Returns a list of the cases for the logged in user (Draft)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> records more than "<count_draft>"
Scenario Outline: Get paging of list Draft Scenario Outline: Get paging of list Draft
@@ -126,35 +197,35 @@ Scenario Outline: Get paging of list Draft
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_draft>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 25 | 22 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending and Ascending Scenario Outline: Get order type of Descending and Ascending
@@ -163,7 +234,7 @@ Scenario Outline: Get order type of Descending and Ascending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_draft>"
Examples: Examples:
@@ -179,7 +250,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_draft>"
Examples: Examples:
@@ -194,7 +265,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_draft>"
Examples: Examples:
@@ -209,7 +280,7 @@ Scenario Outline: Get order type of Search of the process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_draft>"
Examples: Examples:
@@ -223,7 +294,7 @@ Scenario: Returns a list of the cases for the logged in user (Participated)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 6 records And the response has <records> records more than "<count_participated>"
Scenario Outline: Get paging of list Participated Scenario Outline: Get paging of list Participated
@@ -232,35 +303,35 @@ Scenario Outline: Get paging of list Participated
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_participated>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 25 | 22 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending an Descending Scenario Outline: Get order type of Descending an Descending
@@ -269,7 +340,7 @@ Scenario Outline: Get order type of Descending an Descending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_participated>"
Examples: Examples:
@@ -285,7 +356,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_participated>"
Examples: Examples:
@@ -300,7 +371,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_participated>"
Examples: Examples:
@@ -316,7 +387,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_participated>"
Examples: Examples:
@@ -330,7 +401,7 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> records more than "<count_unassigned>"
Scenario Outline: Get paging of list Unassigned Scenario Outline: Get paging of list Unassigned
@@ -339,35 +410,35 @@ Scenario Outline: Get paging of list Unassigned
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_unassigned>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 25 | 22 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending and Acending Scenario Outline: Get order type of Descending and Acending
@@ -376,7 +447,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_unassigned>"
Examples: Examples:
@@ -391,7 +462,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_unassigned>"
Examples: Examples:
@@ -406,7 +477,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_unassigned>"
Examples: Examples:
@@ -421,7 +492,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_unassigned>"
Examples: Examples:
@@ -436,7 +507,7 @@ Scenario: Returns a list of the cases for the logged in user (Paused)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> records more than "<count_paused>"
Scenario Outline: Get paging of list Paused Scenario Outline: Get paging of list Paused
@@ -445,35 +516,35 @@ Scenario Outline: Get paging of list Paused
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_paused>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 25 | 22 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending and Acending Scenario Outline: Get order type of Descending and Acending
@@ -482,7 +553,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_paused>"
Examples: Examples:
@@ -497,7 +568,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_paused>"
Examples: Examples:
@@ -512,7 +583,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_paused>"
Examples: Examples:
@@ -527,7 +598,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_paused>"
Examples: Examples:
@@ -541,7 +612,7 @@ Scenario: Returns a list of the cases for the logged in user (Advanced Search)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 1 records And the response has <records> records more than "<count_advanced-search>"
Scenario Outline: Get paging of list Advanced Search Scenario Outline: Get paging of list Advanced Search
@@ -550,35 +621,35 @@ Scenario Outline: Get paging of list Advanced Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "<type>" And the type is "<type>"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
| test_description | start | limit | records | http_code | type | | test_description | start | limit | records | http_code | type |
| lowercase in Start | a | 1 | | 200 | array | | lowercase in Start | a | 1 | 0 | 400 | string |
| uppercase in Start | A | 1 | | 200 | array | | uppercase in Start | A | 1 | 0 | 400 | string |
| lowercase in Limit | 1 | a | | 200 | array | | lowercase in Limit | 1 | a | 0 | 400 | string |
| uppercase in Limit | 1 | A | | 200 | array | | uppercase in Limit | 1 | A | 0 | 400 | string |
| limit=3 | 1 | 3 | | 200 | array | | limit=3 | 1 | 3 | 3 | 200 | array |
| start=3 | 3 | 3 | | 200 | array | | start=3 | 3 | 25 | 22 | 200 | array |
| limit and start =3 | 3 | 3 | | 200 | array | | limit and start =3 | 3 | 3 | 1 | 200 | array |
| high number for start | 1000 | 1 | | 200 | array | | high number for start | 1000 | 1 | 0 | 200 | array |
| high number for start | 1000 | 0 | | 200 | array | | high number for start | 1000 | 0 | 0 | 200 | array |
| empty result | 1 | 0 | | 200 | array | | empty result | 1 | 0 | 1 | 200 | array |
| empty string | 1 | 10000 | | 200 | array | | empty string | 1 | 10000 | 1 | 200 | array |
| invalid start | b | 25 | | 400 | string | | invalid start | b | 25 | 0 | 400 | string |
| invalid limit | 1 | c | | 400 | string | | invalid limit | 1 | c | 0 | 400 | string |
| start equals zero | 0 | 20 | | 400 | string | | start equals zero | 0 | 20 | 20 | 200 | array |
| search 0 | 0 | 0 | | 200 | array | | search 0 | 0 | 0 | 0 | 200 | array |
| search 0 | 0 | 100 | | 200 | array | | search 0 | 0 | 100 | 100 | 200 | array |
| negative numbers in start | -10 | 25 | | 400 | string | | negative numbers in start | -10 | 25 | 25 | 200 | array |
| negative numbers in limit | 1 | -25 | | 400 | string | | negative numbers in limit | 1 | -25 | 25 | 200 | array |
| real numbers | 0.0 | 1.0 | | 200 | string | | real numbers | 0.0 | 1.0 | 0 | 400 | string |
| real numbers in start | 0.0 | 25 | | 200 | string | | real numbers in start | 0.0 | 25 | 0 | 400 | string |
| real numbers in limit | 1 | 1.4599 | | 400 | string | | real numbers in limit | 1 | 1.4599 | 0 | 400 | string |
| only start | 1 | | | 400 | string | | only start | 1 | | 1 | 200 | array |
| only limit | | 25 | | 400 | string | | only limit | | 25 | 1 | 200 | array |
| without start and limit | | | | 400 | string | | without start and limit | | | 1 | 200 | array |
Scenario Outline: Get order type of Descending and Acending Scenario Outline: Get order type of Descending and Acending
@@ -587,7 +658,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -602,7 +673,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -618,7 +689,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -634,7 +705,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -649,7 +720,7 @@ Scenario Outline: Get order for Status
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -666,7 +737,7 @@ Scenario Outline: Get order for User
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:
@@ -683,7 +754,7 @@ Scenario Outline: Get order for date
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records more than "<count_advanced-search>"
Examples: Examples:

View File

@@ -1,37 +1,41 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Input Documents cases Feature: Input Documents cases
Requirements: Requirements:
a workspace with three cases of the process "Test Users-Step-Properties End Point" a workspace with one case of the process "Test Input Document Case"
and there are three Input Document in the process
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: Returns a list of the uploaded documents for a given case Scenario: Returns a list of the uploaded documents for a given case
Given I request "case{uid}/input-documents" Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 5 records
Scenario: Returns an uploaded documents for a given case Scenario: Returns an uploaded documents for a given case
Given I request "case/{uid}/input-document/{uid}" Given I request "cases/3980158475331a1a0288fd3009853776/input-document/6075490825331a1c5eebff9015468244"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "object"
Scenario: Post metadata and then upload documents for a given case Scenario: Post metadata and then upload documents for a given case
Given POST this data: Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/3980158475331a1a0288fd3009853776/input-document"
""" """
{ {
"inp_doc_uid": "inp_doc_uid",
"tas_uid": "tas_uid",
"app_doc_comment": "app_doc_comment"
} }
""" """
And I request "case/{uid}/input-document" Then the response status code should be 201
Then the response status code should be 201
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "object"
@@ -40,7 +44,7 @@ Scenario: Post metadata and then upload documents for a given case
Scenario: Delete an uploaded or generated document from a case. Scenario: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "" stored in session array Given that I want to delete a resource with the key "" stored in session array
And I request "case/{uid}/input-document/{uid}" And I request "cases/3980158475331a1a0288fd3009853776/input-document/{app_doc_uid}"
Then the response status code should be 200 Then the response status code should be 200
And the content type is "application/json" And the content type is "application/json"
And the response charset is "UTF-8" And the response charset is "UTF-8"

View File

@@ -0,0 +1,41 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Input Documents cases
Requirements:
a workspace with one case of the process "Test Input Document Case"
and there are three Input Document in the process and the verify in one case
Background:
Given that I have a valid access_token
Scenario: Returns a list of the uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
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
Scenario Outline: Returns an uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-document/<input-document>"
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:
| test_description | input-document | app_doc_uid | app_doc_filename | doc_uid | app_doc_version | app_doc_create_date | app_doc_create_user | app_doc_type | app_doc_index | app_doc_link |
| Get Input "Desert.jpg" | 6075490825331a1c5eebff9015468244 | 6075490825331a1c5eebff9015468244 | Desert.jpg | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:33:25 | , Administrator (admin) | INPUT | 1 | cases/cases_ShowDocument?a=6075490825331a1c5eebff9015468244&v=1 |
| Get Input "Screenshot Case Archive.docx" | 3770386635331a1f49c78e8070071944 | 3770386635331a1f49c78e8070071944 | Screenshot Case Archive.docx | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:34:12 | , Administrator (admin) | INPUT | 2 | cases/cases_ShowDocument?a=3770386635331a1f49c78e8070071944&v=1 |
| Get Input "alert_message.html" | 6382509235331a235b27a82003894796 | 6382509235331a235b27a82003894796 | alert_message.htm | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:17 | , Administrator (admin) | INPUT | 4 | cases/cases_ShowDocument?a=6382509235331a235b27a82003894796&v=1 |
| Get Input "actionsByEmail-2.5.0.28.tar" | 3548449385331a24a34d273018695729 | 3548449385331a24a34d273018695729 | actionsByEmail-2.5.0.28.tar | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:38 | , Administrator (admin) | INPUT | 5 | cases/cases_ShowDocument?a=3548449385331a24a34d273018695729&v=1 |
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |

View File

@@ -1,42 +1,42 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Output Documents cases Feature: Output Documents cases
Requirements: Requirements:
a workspace with three cases of the process "Test Users-Step-Properties End Point" a workspace with one case of the process "Test Output Document Case"
and there are six Output Documents in the process
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: Returns a list of the generated documents for a given case Scenario: Returns a list of the generated documents for a given cases
Given I request "case{uid}/output-documents" Given I request "cases/24438110553330068247694030259829/output-documents"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 6 records
Scenario: Returns an uploaded documents for a given case Scenario: Returns an generated document for a given case
Given I request "case/{uid}/output-document/{uid}" Given I request "cases/24438110553330068247694030259829/output-document/3000248055333006ab56a01005891659"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "Object"
Scenario: Generate or regenerates an output documents for a given case Scenario: Generate or regenerates an output documents for a given case
Given POST this data: Given POST this data:
""" """
{ {
"out_doc_uid": "2087233055331ef4127d238097105696"
} }
""" """
And I request "case/{uid}/output-document" And I request "case/24438110553330068247694030259829/output-document"
Then the response status code should be 201 Then the response status code should be 201
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "array"
And store "" in session array
Scenario: Delete an uploaded or generated document from a case. Scenario: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "" stored in session array Given that I want to delete a resource with the key "" stored in session array

View File

@@ -0,0 +1,95 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Output Documents cases Main Tests
Requirements:
a workspace with one case of the process "Test Output Document Case"
and there are six Output Documents in the process
Background:
Given that I have a valid access_token
Scenario Outline: Generate or regenerates an output documents for a given case
Given POST this data:
"""
{
"out_doc_uid": "<out_doc_uid>"
}
"""
And I request "cases/551390121533343ee886813057396196/output-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 "array"
And store "app_doc_uid" in session array as variable "app_doc_uid_<app_doc_uid_number>"
Examples:
| test_description | app_doc_uid_number | out_doc_uid |
| Generate "output document only doc" | 1 | 2087233055331ef4127d238097105696 |
| Generate "output document with versioning" | 2 | 5961108155331efc976cee7011445347 |
| Generate "output document only pdf" | 3 | 7074907425331ef837aa8b2055964905 |
| Generate "output document old version" | 4 | 7385645355331ee70ea6a87029841722 |
| Generate "output document with pdf security" | 5 | 8594478445331eff2d30767061922215 |
Scenario: Returns a list of the generated documents for a given cases
Given I request "cases/551390121533343ee886813057396196/output-documents"
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 "app_doc_filename" property in row 0 equals "output document new version.pdf"
And the "app_doc_filename" property in row 1 equals "output document with pdf security.pdf"
And the "app_doc_filename" property in row 2 equals "output document only pdf.pdf"
And the "app_doc_filename" property in row 3 equals "output document only doc.doc"
And the "app_doc_filename" property in row 4 equals "output document with versioning.pdf"
And the "app_doc_filename" property in row 5 equals "output document old version.pdf"
Scenario Outline: Returns an generated document for a given case
Given I request "cases/551390121533343ee886813057396196/output-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:
| test_description | app_doc_uid_number | app_doc_filename | doc_uid | app_doc_version | app_doc_create_date | app_doc_create_user | app_doc_type | app_doc_index | app_doc_link |
| Get Output "output document new version.pdf" | 1 | output document new version.pdf | 3391282325331ee81c84715031595672 | 1 | 2014-03-26 12:29:30 | , Administrator (admin) | OUTPUT BOTH | 1 | cases/cases_ShowOutputDocument?a=3000248055333006ab56a01005891659&v=1&ext=pdf&random=1256696859 |
| Get Output "output document old version.pdf" | 2 | output document old version.pdf | 7385645355331ee70ea6a87029841722 | 1 | 2014-03-26 12:29:33 | , Administrator (admin) | OUTPUT BOTH | 2 | cases/cases_ShowOutputDocument?a=8865432395333006d75d824038425476&v=1&ext=pdf&random=1838956992 |
| Get Output "output document only doc.doc" | 3 | output document only doc.doc | 2087233055331ef4127d238097105696 | 1 | 2014-03-26 12:29:35 | , Administrator (admin) | OUTPUT DOC | 3 | cases/cases_ShowOutputDocument?a=4447256265333006fe6fb00061503934&v=1&ext=doc&random=949245639 |
| Get Output "output document only pdf.pdf" | 4 | output document only pdf.pdf | 7074907425331ef837aa8b2055964905 | 1 | 2014-03-26 12:29:38 | , Administrator (admin) | OUTPUT PDF | 4 | cases/cases_ShowOutputDocument?a=828039615533300724fdcb6091842678&v=1&ext=pdf&random=401448562 |
| Get Output "output document with pdf security.pdf" | 5 | output document with pdf security.pdf | 8594478445331eff2d30767061922215 | 1 | 2014-03-26 12:29:40 | , Administrator (admin) | OUTPUT BOTH | 5 | cases/cases_ShowOutputDocument?a=25293137553330074713ab9073501576&v=1&ext=pdf&random=324546362 |
| Get Output "output document with versioning.pdf" | 6 | output document with versioning.pdf | 5961108155331efc976cee7011445347 | 1 | 2014-03-26 12:29:42 | , Administrator (admin) | OUTPUT BOTH | 6 | cases/cases_ShowOutputDocument?a=354826487533300769e65e0027827984&v=1&ext=pdf&random=1682978530 |
Scenario Outline: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
And I request "cases/551390121533343ee886813057396196/output-document"
And 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:
| app_doc_uid_number |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |

View File

@@ -1191,6 +1191,8 @@ class RestContext extends BehatContext
} }
$this->_restDeleteQueryStringSuffix = "/" . $varValue; $this->_restDeleteQueryStringSuffix = "/" . $varValue;
$this->printDebug("$varName = $varValue\nsessionVarName = $sessionVarName\n");
$this->_restObjectMethod = 'delete'; $this->_restObjectMethod = 'delete';
} }
@@ -1259,7 +1261,7 @@ class RestContext extends BehatContext
$pageUrl = str_replace($varName, $varValue, $pageUrl); $pageUrl = str_replace($varName, $varValue, $pageUrl);
//$this->printDebug("URL: $pageUrl\n$varName = $varValue\n"); $this->printDebug("URL: $pageUrl\n$varName = $varValue\nsessionVarName = $sessionVarName\n");
$this->iRequest($pageUrl, $urlType); $this->iRequest($pageUrl, $urlType);
@@ -1435,4 +1437,87 @@ class RestContext extends BehatContext
$this->_restObjectMethod = 'delete'; $this->_restObjectMethod = 'delete';
} }
/**
* @Given /^store response count in session variable as "([^"]*)"$/
*/
public function storeResponseCountInSessionVariableAs($varName)
{
$data = $this->_data;
$currentRecordsCount=count($data);
if (file_exists("session.data")) {
$sessionData = json_decode(file_get_contents("session.data"));
} else {
$sessionData = new StdClass();
}
$sessionData->$varName = $currentRecordsCount;
file_put_contents("session.data", json_encode($sessionData));
}
/**
* @Given /^the response has (\d+) records more than "([^"]*)"$/
*/
public function theResponseHasRecordsMoreThan($records, $base)
{
if (file_exists("session.data")) {
$sessionData = json_decode(file_get_contents("session.data"));
} else {
$sessionData = array();
}
if (!isset($sessionData->$base) ) {
$varValue = '';
} else {
$varValue = $sessionData->$base;
}
$totalRecords=$varValue + $records;
$this->theResponseHasRecords($totalRecords);
}
/**
* @Given /^POST upload an input document "([^"]*)" to "([^"]*)"$/
*/
public function postUploadAnInputDocumentTo($file, $url, PyStringNode $string)
{
$baseUrl = $this->getParameter('base_url');
$url = $baseUrl.$url;
$accesstoken = $this->getParameter('access_token');
$headr = array();
$headr[] = 'Authorization: Bearer '.$accesstoken;
$postFields = json_decode($string);
$postFields->form ='@'.$file;
//print_r($postFields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
print_r($postResult);
curl_close($ch);
//Save result as usual
$this->_type = 'json';
//$this->_response = json_decode($postResult);
$this->_data = json_decode($postResult);
// $postResult = (array)json_decode($postResult);
}
} }