Merged in wnestor/processmaker (pull request #167)

Mejoras y avances a los features Output Document, process, report table y web entry
This commit is contained in:
erik ao
2014-02-10 10:44:45 -04:00
7 changed files with 288 additions and 94 deletions

View File

@@ -17,7 +17,7 @@ Feature: Output Documents Main Tests
And the type is "array"
And the response has 2 records
And the "out_doc_title" property in row 0 equals "Endpoint Old Version (base)"
And the "out_doc_title" property in row 1 equals "Endpoint New Version (base)"
And the "out_doc_title" property in row 1 equals "Endpoint New Version (base)
Scenario: Get a single output document of a project

View File

@@ -0,0 +1,51 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process of a Project Resources
Requirements:
a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded
there are three activities in the process
Background:
Given that I have a valid access_token
#GET /api/1.0/{workspace}/project/{prj_uid}/process
# Get a single Process
Scenario Outline: Get a single Process
Given that I want to get a resource with the key "obj_uid" stored in session array
And I request "project/14414793652a5d718b65590036026581/process"
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"
And that "pro_title" is set to "<pro_title>"
And that "pro_description" is set to "<pro_description>"
And that "pro_status" is set to "<pro_status>"
And that "pro_create_user" is set to "<pro_create_user>"
And that "pro_debug" is set to "<pro_debug>"
Examples:
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |
#PUT /api/1.0/{workspace}/project/{prj_uid}/process
# Update Process
Scenario Outline: Update Process
Given PUT this data:
"""
{
"pro_title": "<pro_title>",
"pro_description": "<pro_description>",
"pro_status": "<pro_status>",
"pro_create_user": "<pro_create_user>",
"pro_debug": <pro_debug>
}
"""
And I request "project/14414793652a5d718b65590036026581/process"
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:
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |

View File

@@ -0,0 +1,104 @@
@ProcessMakerMichelangelo @RestAPI
Feature: DataBase Connections
Scenario: List all the database connections (result 0 database connections)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record
Scenario: Create a new database connection
Given that I have a valid access_token
And POST this data:
"""
{
"rep_tab_name" : "PMT_TEST",
"rep_tab_dsc" : "descripcion de la tabla",
"rep_tab_connection" : "workflow",
"rep_tab_type" : "NORMAL",
"rep_tab_grid" : "",
"fields" : [
{
"fld_dyn" : "COMBO_ACEPTACION",
"fld_name" : "ACEPTACION",
"fld_label" : "ACEPTACION",
"fld_type" : "VARCHAR",
"fld_size" : 5
},{
"fld_name" : "CAMPO_PROPIO",
"fld_label" : "CAMPO_PROPIO",
"fld_type" : "VARCHAR",
"fld_size" : 200
}
]
}
"""
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 201
And store "rep_uid" in session array
@3: TEST FOR GET DATABASE CONNECTIONS /----------------------------------------------------------------------
Scenario: List all the database connections (result 1 database connection)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 1 record
@4: TEST FOR PUT DATABASE CONNECTION /-----------------------------------------------------------------------
Scenario: Update a database connection
Given that I have a valid access_token
And PUT this data:
"""
{
"rep_tab_dsc" : "nueva descripcion",
"fields" : [
{
"fld_dyn" : "CAMPO_TEXTO",
"fld_name" : "TEXTO",
"fld_label" : "TEXTO",
"fld_type" : "VARCHAR",
"fld_size" : 100
},{
"fld_name" : "CAMPO_PROPIO",
"fld_label" : "CAMPO_PROPIO",
"fld_type" : "VARCHAR",
"fld_size" : 200
}
]
}
"""
And that I want to update a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Scenario: Get a database connection (with change in "dbs_description" and "dbs_database_name")
Given that I have a valid access_token
And that I want to get a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "rep_tab_dsc" is set to "nueva descripcion"
Scenario: Delete a database connection
Given that I have a valid access_token
And that I want to delete a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
@7: TEST FOR GET DATABASE CONNECTIONS /----------------------------------------------------------------------
Scenario: List all the database connections (result 0 database connections)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record

View File

@@ -1,104 +1,138 @@
@ProcessMakerMichelangelo @RestAPI
Feature: DataBase Connections
Feature: Report Tables
Scenario: List all the database connections (result 0 database connections)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Background:
Given that I have a valid access_token
Scenario: Verify that there are no report tables
Given I request "project/922677707524ac7417ce345089010125/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record
Scenario Outline: Create new report tables from dynaform and grid
Given POST this data:
"""
{
"rep_tab_name" : "<rep_tab_name>",
"rep_tab_dsc" : "<rep_tab_dsc>",
"rep_tab_connection" : "<rep_tab_connection>",
"rep_tab_type" : "<rep_tab_type>",
"rep_tab_grid" : "<rep_tab_grid>",
"fields" : [
{
"fld_dyn" : "<fld_dyn_1>",
"fld_name" : "<fld_name_1>",
"fld_label" : "<fld_label_1>",
"fld_type" : "<fld_type_1>",
"fld_size" : "<fld_size_1>"
},{
"fld_dyn" : "<fld_dyn_2>",
"fld_name" : "<fld_name_2>",
"fld_label" : "<fld_label_2>",
"fld_type" : "<fld_type_2>",
"fld_size" : "<fld_size_2>"
},{
"fld_dyn" : "<fld_dyn_3>",
"fld_name" : "<fld_name_3>",
"fld_label" : "<fld_label_3>",
"fld_type" : "<fld_type_3>",
"fld_size" : "<fld_size_3>"
}
]
}
"""
And I request "project/<project>/report-table"
Then the response status code should be 201
And store "rep_uid" in session array as variable "rep_uid_<rep_uid_number>"
Examples:
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
Scenario: Verify that there are 2 report tables
Given I request "project/922677707524ac7417ce345089010125/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 2 record
Scenario Outline: Update a created report tables
Given PUT this data:
"""
{
"rep_tab_dsc" : "<rep_tab_dsc>",
"fields" : [
{
"fld_dyn" : "<fld_dyn_1>",
"fld_name" : "<fld_name_1>",
"fld_label" : "<fld_label_1>",
"fld_type" : "<fld_type_1>",
"fld_size" : "<fld_size_1>"
},{
"fld_dyn" : "<fld_dyn_2>",
"fld_name" : "<fld_name_2>",
"fld_label" : "<fld_label_2>",
"fld_type" : "<fld_type_2>",
"fld_size" : "<fld_size_2>"
},{
"fld_dyn" : "<fld_dyn_3>",
"fld_name" : "<fld_name_3>",
"fld_label" : "<fld_label_3>",
"fld_type" : "<fld_type_3>",
"fld_size" : "<fld_size_3>"
}
]
}
"""
And that I want to update a resource with the key "rep_uid" stored in session array as variable "rep_uid_<rep_uid_number>"
And I request "project/<project>/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Examples:
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
Scenario Outline: Get a details of created report tables
Given that I want to get a resource with the key "rep_uid" stored in session array as variable "rep_uid_<rep_uid_number>"
And I request "project/<project>/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record
And the type is "object"
And that "rep_tab_name" is set to "<rep_tab_name>"
And that "rep_tab_dsc" is set to "<rep_tab_dsc>"
Examples:
Scenario: Create a new database connection
Given that I have a valid access_token
And POST this data:
"""
{
"rep_tab_name" : "PMT_TEST",
"rep_tab_dsc" : "descripcion de la tabla",
"rep_tab_connection" : "workflow",
"rep_tab_type" : "NORMAL",
"rep_tab_grid" : "",
"fields" : [
{
"fld_dyn" : "COMBO_ACEPTACION",
"fld_name" : "ACEPTACION",
"fld_label" : "ACEPTACION",
"fld_type" : "VARCHAR",
"fld_size" : 5
},{
"fld_name" : "CAMPO_PROPIO",
"fld_label" : "CAMPO_PROPIO",
"fld_type" : "VARCHAR",
"fld_size" : 200
}
]
}
"""
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 201
And store "rep_uid" in session array
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
@3: TEST FOR GET DATABASE CONNECTIONS /----------------------------------------------------------------------
Scenario: List all the database connections (result 1 database connection)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 1 record
@4: TEST FOR PUT DATABASE CONNECTION /-----------------------------------------------------------------------
Scenario: Update a database connection
Given that I have a valid access_token
And PUT this data:
"""
{
"rep_tab_dsc" : "nueva descripcion",
"fields" : [
{
"fld_dyn" : "CAMPO_TEXTO",
"fld_name" : "TEXTO",
"fld_label" : "TEXTO",
"fld_type" : "VARCHAR",
"fld_size" : 100
},{
"fld_name" : "CAMPO_PROPIO",
"fld_label" : "CAMPO_PROPIO",
"fld_type" : "VARCHAR",
"fld_size" : 200
}
]
}
"""
And that I want to update a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Scenario Outline: Delete a created database connections
Given that I want to delete a resource with the key "rep_uid" stored in session array as variable "rep_uid_<rep_uid_number>"
And I request "project/<project>/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Examples:
Scenario: Get a database connection (with change in "dbs_description" and "dbs_database_name")
Given that I have a valid access_token
And that I want to get a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "rep_tab_dsc" is set to "nueva descripcion"
| test_description | project | rep_uid_number |
| | 922677707524ac7417ce345089010125 | 1 |
| | 922677707524ac7417ce345089010125 | 2 |
Scenario: Delete a database connection
Given that I have a valid access_token
And that I want to delete a resource with the key "dbs_uid" stored in session array
And I request "project/96189226752f3e5e23c1303036042196/report-table"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
@7: TEST FOR GET DATABASE CONNECTIONS /----------------------------------------------------------------------
Scenario: List all the database connections (result 0 database connections)
Given that I have a valid access_token
And I request "project/96189226752f3e5e23c1303036042196/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record
Scenario: Verify that the report tables were deleted correctly
Given I request "project/922677707524ac7417ce345089010125/report-tables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the response has 0 record

View File

@@ -0,0 +1,5 @@
@ProcessMakerMichelangelo @RestAPI
Feature: DataBase Connections
Background:
Given that I have a valid access_token

View File

@@ -25,7 +25,7 @@ Feature: Webentry Negative Tests
| test_description | project | tas_uid | tas_title | dyn_uid | dyn_title | method | usr_username | usr_password | error_code | error_message |
| Invalid method | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 | DynaForm Demo1 | JS | admin | admin | 400 | method |
| Invalid usr_username | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 | DynaForm Demo2 | HTML | aaro | admin | 400 | users |
| Invalid usr_username | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 | DynaForm Demo2 | JS | aaro | admin | 400 | method |
| Invalid usr_password | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 | DynaForm Demo1 | WS | admin | sample | 400 | password |
| Field required prj_uid | | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 | DynaForm Demo2 | HTML | admin | admin | 400 | prj_uid |
| Field required tas_uid | 28733629952e66a362c4f63066393844 | | Task 1 | 60308801852e66b7181ae21045247174 | DynaForm Demo1 | WS | admin | admin | 400 | tas_uid |

View File

@@ -438,7 +438,7 @@ class RestContext extends BehatContext
$message = 'unexpected control character found';
break;
case JSON_ERROR_SYNTAX :
$message = 'malformed JSON';
$message = "malformed JSON \n\n ------\n".$this->_response->getBody(true)."\n ------";
break;
case JSON_ERROR_UTF8 :
$message = 'malformed UTF-8 characters, possibly ' .