From 25abc1f1933447e56653c03a4cfea54ca84561a3 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Mon, 10 Feb 2014 09:43:08 -0400 Subject: [PATCH] Mejoras y avances a los features Output Document, process, report table y web entry --- .../main_tests_output.feature | 2 +- .../main_tests_process.feature | 51 +++++ .../basic_sequence_report_tables.feature | 104 +++++++++ .../main_tests_report_tables.feature | 216 ++++++++++-------- .../negative_tests_report_tables.feature | 5 + .../negative_tests_web_entry.feature | 2 +- features/bootstrap/RestContext.php | 2 +- 7 files changed, 288 insertions(+), 94 deletions(-) create mode 100644 features/backend/report_tables/basic_sequence_report_tables.feature create mode 100644 features/backend/report_tables/negative_tests_report_tables.feature diff --git a/features/backend/output_documents/main_tests_output.feature b/features/backend/output_documents/main_tests_output.feature index e00c39f62..335198ffd 100644 --- a/features/backend/output_documents/main_tests_output.feature +++ b/features/backend/output_documents/main_tests_output.feature @@ -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 diff --git a/features/backend/process_project_resources/main_tests_process.feature b/features/backend/process_project_resources/main_tests_process.feature index e69de29bb..cb46a521d 100644 --- a/features/backend/process_project_resources/main_tests_process.feature +++ b/features/backend/process_project_resources/main_tests_process.feature @@ -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 "" + And that "pro_description" is set to "" + And that "pro_status" is set to "" + And that "pro_create_user" is set to "" + And that "pro_debug" is set to "" + + 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_description": "", + "pro_status": "", + "pro_create_user": "", + "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 | + diff --git a/features/backend/report_tables/basic_sequence_report_tables.feature b/features/backend/report_tables/basic_sequence_report_tables.feature new file mode 100644 index 000000000..526d0beec --- /dev/null +++ b/features/backend/report_tables/basic_sequence_report_tables.feature @@ -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 \ No newline at end of file diff --git a/features/backend/report_tables/main_tests_report_tables.feature b/features/backend/report_tables/main_tests_report_tables.feature index 526d0beec..47e19d5c5 100644 --- a/features/backend/report_tables/main_tests_report_tables.feature +++ b/features/backend/report_tables/main_tests_report_tables.feature @@ -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_dsc" : "", + "rep_tab_connection" : "", + "rep_tab_type" : "", + "rep_tab_grid" : "", + "fields" : [ + { + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + },{ + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + },{ + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + } + ] + } + """ + And I request "project//report-table" + Then the response status code should be 201 + And store "rep_uid" in session array as variable "rep_uid_" + + 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" : "", + "fields" : [ + { + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + },{ + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + },{ + "fld_dyn" : "", + "fld_name" : "", + "fld_label" : "", + "fld_type" : "", + "fld_size" : "" + } + ] + } + """ + + And that I want to update a resource with the key "rep_uid" stored in session array as variable "rep_uid_" + And I request "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_" + And I request "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 "" + And that "rep_tab_dsc" is set to "" + 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_" + And I request "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 \ No newline at end of file +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 diff --git a/features/backend/report_tables/negative_tests_report_tables.feature b/features/backend/report_tables/negative_tests_report_tables.feature new file mode 100644 index 000000000..dfe99092d --- /dev/null +++ b/features/backend/report_tables/negative_tests_report_tables.feature @@ -0,0 +1,5 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: DataBase Connections + +Background: +Given that I have a valid access_token diff --git a/features/backend/web_entry/negative_tests_web_entry.feature b/features/backend/web_entry/negative_tests_web_entry.feature index c8aea6ded..c75066e47 100644 --- a/features/backend/web_entry/negative_tests_web_entry.feature +++ b/features/backend/web_entry/negative_tests_web_entry.feature @@ -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 | diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index c25c04aba..4e2e88482 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -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 ' .