diff --git a/Rakefile b/Rakefile index 40f0a5ebb..920ab3a8f 100644 --- a/Rakefile +++ b/Rakefile @@ -230,8 +230,7 @@ def buildMafe(homeDir, targetDir, mode) "#{homeDir}/build/js/designer.js" => "#{mafeDir}/designer.min.js", "#{homeDir}/build/js/mafe.js" => "#{mafeDir}/mafe.min.js", "#{homeDir}/build/css/mafe.css" => "#{mafeDir}/mafe.min.css", - "#{homeDir}/img/*.*" => "#{imgTargetDir}", - "#{homeDir}/srcForm/img/*.*" => "#{imgTargetDir}" + "#{homeDir}/img/*.*" => "#{imgTargetDir}" }) puts "\nCopying lib files into: #{jsTargetDir}".bold diff --git a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature index f9efe0209..5f4671381 100644 --- a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature +++ b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature @@ -1,32 +1,25 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar -Requirements: - a workspace with two calendar in this workspace "Default Calendar and Test Process" + Requirements: + a workspace with one calendar in this workspace "Default Calendar" -Background: + Background: Given that I have a valid access_token -Scenario: List of calendar + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar Given I request "calendars" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 2 records + And the response has 1 records -Scenario: Get a single calendar - Given I request "calendar/14606161052f50839307899033145440" - 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 the "cal_uid" property equals "14606161052f50839307899033145440" - And the "cal_name" property equals "Test Process" - And the "cal_description" property equals "Calendar para el feature Process" - - -Scenario Outline: Create a new Calendars + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendars Given POST this data: """ { @@ -38,8 +31,8 @@ Scenario Outline: Create a new Calendars {"day": 7, "hour_start": "09:00", "hour_end": "17:00"} ], "cal_holiday": [ - {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"}, - {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} + {"name": "holiday1", "date_start": "2015-01-01", "date_end": "2015-01-10"}, + {"name": "holiday2", "date_start": "2015-04-01", "date_end": "2015-04-04"} ] } """ @@ -50,14 +43,15 @@ Scenario Outline: Create a new Calendars And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | - | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | - | Create calendar 2 | 2 | Calendar 2 | Prueba de Creacion de Calendario 2 | + Examples: + | cal_uid_number | cal_name | cal_description | + | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | + | 2 | Calendar 2 | Prueba de Creacion de Calendario 2 | -Scenario Outline: Update the calendars and then check if the values had changed + # PUT /api/1.0/{workspace}/calendar + # Update a Calendar + Scenario Outline: Update the calendars and then check if the values had changed Given PUT this data: """ { @@ -74,7 +68,6 @@ Scenario Outline: Update the calendars and then check if the values had changed {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} ] } - """ And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" @@ -82,14 +75,15 @@ Scenario Outline: Update the calendars and then check if the values had changed Then the response status code should be 200 And the response charset is "UTF-8" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | - | Update calendar 1 | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | + | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Get a single calendar + # GET /api/1.0/{workspace}/calendar + # Get an specific Calendar + Scenario Outline: Get a single calendar Given that I want to get a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" Then the response status code should be 200 @@ -97,25 +91,34 @@ Scenario Outline: Get a single calendar And the content type is "application/json" And the type is "object" And the "cal_name" property equals "" - And the "cal_description" property equals "" - And the "cal_status" property equals "" + And the "cal_description" property equals "" + And the "cal_status" property equals "" - Examples: - - | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Delete all Calendars created previously in this script + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario Outline: Delete all Calendars created previously in this script (one by one ) Given that I want to delete a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" And the content type is "application/json" Then the response status code should be 200 - - - Examples: + Examples: | cal_uid_number | | 1 | - | 2 | \ No newline at end of file + | 2 | + + + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records \ No newline at end of file diff --git a/features/backend/admin_setup/calendar/main_tests_calendar.feature b/features/backend/admin_setup/calendar/main_tests_calendar.feature index a52b596b4..2050e44ed 100644 --- a/features/backend/admin_setup/calendar/main_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/main_tests_calendar.feature @@ -1,31 +1,25 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar Main Tests -Requirements: - a workspace with two calendar in this workspace "Default Calendar and Test Process" + Requirements: + a workspace with one calendar in this workspace "Default Calendar" -Background: + Background: Given that I have a valid access_token -Scenario: List of calendar + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar Given I request "calendars" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 2 records + And the response has 1 records -Scenario: Get a single calendar "Test Process" - Given I request "calendar/14606161052f50839307899033145440" - 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 the "cal_uid" property equals "14606161052f50839307899033145440" - And the "cal_name" property equals "Test Process" - And the "cal_description" property equals "Calendar para el feature Process" - -Scenario: Get a single calendar "Default Calendar" + # GET /api/1.0/{workspace}/calendar/ + # Get an specific Calendar + Scenario: Get a single calendar "Default Calendar" Given I request "calendar/00000000000000000000000000000001" Then the response status code should be 200 And the response charset is "UTF-8" @@ -36,7 +30,9 @@ Scenario: Get a single calendar "Default Calendar" And the "cal_description" property equals "Default Calendar" -Scenario Outline: Create a new Calendars + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create new Calendars (one by one) Given POST this data: """ { @@ -60,16 +56,17 @@ Scenario Outline: Create a new Calendars And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | - | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | + Examples: + | test_description | cal_uid_number | cal_name | cal_description | + | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | | Create calendar with short name | 2 | C | Prueba de Creacion de Calendario 2 | | Create calendar with name long | 3 | Creacion de nuevo Calendar con nombre largo para las pruebas behat | Prueba de Creacion de Calendario 3 | | Create calendar with special character | 4 | Calendar 4 !@#$%^& | Prueba de Creacion de Calendario 4 | - -Scenario Outline: Create a new Calendar with parameter cal_work_days diferent + + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_work_days diferent Given POST this data: """ { @@ -93,13 +90,14 @@ Scenario Outline: Create a new Calendar with parameter cal_work_days diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 5 | -Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent Given POST this data: """ { @@ -123,13 +121,14 @@ Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 6 | -Scenario Outline: Create a new Calendar with parameter cal_holiday diferent + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_holiday diferent Given POST this data: """ { @@ -153,13 +152,14 @@ Scenario Outline: Create a new Calendar with parameter cal_holiday diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 7 | -Scenario: Create a new Calendar with same name + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendar with same name Given POST this data: """ { @@ -181,8 +181,9 @@ Scenario: Create a new Calendar with same name And the response status message should have the following text "already exists" - -Scenario Outline: Update the calendars and then check if the values had changed + # PUT /api/1.0/{workspace}/calendar + # Update a Calendar + Scenario Outline: Update the calendars and then check if the values had changed Given PUT this data: """ { @@ -199,7 +200,6 @@ Scenario Outline: Update the calendars and then check if the values had changed {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} ] } - """ And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" @@ -207,43 +207,15 @@ Scenario Outline: Update the calendars and then check if the values had changed Then the response status code should be 200 And the response charset is "UTF-8" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | test_description | cal_uid_number | cal_name | cal_description | cal_status | | Update calendar 1 | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Update the calendars with same name - Given PUT this data: - """ - { - "cal_name": "", - "cal_description": "", - "cal_work_days": [1,2,3,4,5], - "cal_status": "", - "cal_work_hour": [ - {"day": 4, "hour_start": "02:00", "hour_end": "21:00"}, - {"day": 0, "hour_start": "09:00", "hour_end": "17:00"} - ], - "cal_holiday": [ - {"name": "Dia del trabajo", "date_start": "2014-05-01", "date_end": "2014-05-01"} - ] - } - - """ - And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" - And I request "calendar" - Then the response status code should be 400 - And the response status message should have the following text "already exists" - - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | - | Update calendar 1 | 1 | Test Process | Calendar para el feature Process | ACTIVE | - - -Scenario Outline: Get a single calendar + # GET /api/1.0/{workspace}/calendar + # Get an specific Calendar + Scenario Outline: Get a single calendar Given that I want to get a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" Then the response status code should be 200 @@ -251,25 +223,34 @@ Scenario Outline: Get a single calendar And the content type is "application/json" And the type is "object" And the "cal_name" property equals "" - And the "cal_description" property equals "" - And the "cal_status" property equals "" + And the "cal_description" property equals "" + And the "cal_status" property equals "" - Examples: - - | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Delete all Calendars created previously in this script + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 8 records + + + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario Outline: Delete all Calendars created previously in this script Given that I want to delete a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" And the content type is "application/json" Then the response status code should be 200 - - - Examples: + Examples: | cal_uid_number | | 1 | | 2 | @@ -277,4 +258,14 @@ Scenario Outline: Delete all Calendars created previously in this script | 4 | | 5 | | 6 | - | 7 | \ No newline at end of file + | 7 | + + + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records \ No newline at end of file diff --git a/features/backend/admin_setup/calendar/negative_tests_calendar.feature b/features/backend/admin_setup/calendar/negative_tests_calendar.feature index 2aa083afa..c761f9a44 100644 --- a/features/backend/admin_setup/calendar/negative_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/negative_tests_calendar.feature @@ -1,12 +1,13 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar Negative Tests - -Background: + Background: Given that I have a valid access_token -Scenario Outline: Create a new Calendars (Negative Tests) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create new Calendars (Without cal_name) Given POST this data: """ { @@ -27,13 +28,14 @@ Scenario Outline: Create a new Calendars (Negative Tests) Then the response status code should be And the response status message should have the following text "" - Examples: + Examples: + | cal_name | cal_description | error_code | error_message | + | | Prueba de Creacion de Calendario 1 | 400 | cal_name | - | test_description | cal_name | cal_description | error_code | error_message | - | Create whitout cal_name | | Prueba de Creacion de Calendario 1 | 400 | cal_name | - -Scenario: Create a new Calendars (Wrong cal_work_days) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Wrong cal_work_days) Given POST this data: """ { @@ -55,7 +57,9 @@ Scenario: Create a new Calendars (Wrong cal_work_days) And the response status message should have the following text "cal_work_days" -Scenario: Create a new Calendars (cal_work_hour . day) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (cal_work_hour . day) Given POST this data: """ { @@ -77,7 +81,9 @@ Scenario: Create a new Calendars (cal_work_hour . day) And the response status message should have the following text "day" -Scenario: Create a new Calendars (without cal_work_days) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Without cal_work_days) Given POST this data: """ { @@ -99,7 +105,9 @@ Scenario: Create a new Calendars (without cal_work_days) And the response status message should have the following text "cal_work_days" -Scenario: Create a new Calendars (wrong date_start ) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Wrong date_start ) Given POST this data: """ { @@ -120,8 +128,9 @@ Scenario: Create a new Calendars (wrong date_start ) Then the response status code should be 400 And the response status message should have the following text "date_start" - -Scenario: Create a new Calendars (wrong date_end) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (wrong date_end) Given POST this data: """ { @@ -143,7 +152,9 @@ Scenario: Create a new Calendars (wrong date_end) And the response status message should have the following text "date_end" -Scenario: Create a new Calendars (with work days less than 3) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (With work days less than 3) Given POST this data: """ { @@ -165,9 +176,10 @@ Scenario: Create a new Calendars (with work days less than 3) And the response status message should have the following text "least 3 Working Days" - -Scenario: Delete Calendar when it is assigned to a project "Test Process" + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario: Delete a Calendar that does not exists Given that I want to delete a "Calendar" And I request "calendar/14606161052f50839307899033145440" Then the response status code should be 400 - And the response status message should have the following text "cannot be deleted" \ No newline at end of file + And the response status message should have the following text "does not exist" \ No newline at end of file diff --git a/features/backend/admin_setup/category/basic_sequence_category.feature b/features/backend/admin_setup/category/basic_sequence_category.feature index 1957bbdcc..08c39793a 100644 --- a/features/backend/admin_setup/category/basic_sequence_category.feature +++ b/features/backend/admin_setup/category/basic_sequence_category.feature @@ -1,31 +1,27 @@ @ProcessMakerMichelangelo @RestAPI Feature: Process Category Requirements: - a workspace with the workspace with one process category + a workspace with the workspace with one process category -Background: + Background: Given that I have a valid access_token -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 1 records + And the response has 0 records -Scenario: Get a Category specific - Given I request "project/category/4177095085330818c324501061677193" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - - -Scenario: Create a new Categories + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario: Create a new Category Given POST this data: """ { @@ -40,33 +36,61 @@ Scenario: Create a new Categories And store "cat_uid" in session array as variable "cat_uid" -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 2 records + And the response has 1 records -Scenario: Update the Category created in this script + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario: Update the Category created in this script Given PUT this data: - """ + """ { "cat_name": "Name Updated" } """ - And that I want to update a resource with the key "cat_uid" stored in session array - And I request "project/category" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" + And that I want to update a resource with the key "cat_uid" stored in session array + And I request "project/category" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" -Scenario: Delete the Category created previously in this script + # GET /api/1.0/{workspace}/project/category/ + # Get an specific Category + Scenario: Get an specific Category + Given that I want to get a resource with the key "cat_uid" stored in session array + And I request "project/category" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + + + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario: Delete the Category created previously in this script Given that I want to delete a resource with the key "cat_uid" stored in session array - And I request "project/category" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" \ No newline at end of file + And I request "project/category" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories + Given I request "project/categories" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 0 records \ No newline at end of file diff --git a/features/backend/admin_setup/category/main_tests_category.feature b/features/backend/admin_setup/category/main_tests_category.feature index 6b1c5148a..63d0e35bc 100644 --- a/features/backend/admin_setup/category/main_tests_category.feature +++ b/features/backend/admin_setup/category/main_tests_category.feature @@ -1,34 +1,27 @@ @ProcessMakerMichelangelo @RestAPI Feature: Process Category Main Test Requirements: - a workspace with the workspace with one process category + a workspace with the workspace with one process category -Background: + Background: Given that I have a valid access_token -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 1 records - + And the response has 0 records -Scenario: Get a Category specific - Given I request "project/category/4177095085330818c324501061677193" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the "cat_uid" property equals "4177095085330818c324501061677193" - And the "cat_name" property equals "Category Cases Lists" - And the "cat_total_processes" property equals 6 - -Scenario Outline: Create a new Categories + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario Outline: Create new Categories Given POST this data: """ { @@ -42,18 +35,20 @@ Scenario Outline: Create a new Categories And the type is "object" And store "cat_uid" in session array as variable "cat_uid_" - Examples: - + Examples: | test_description | cat_uid_number | cat_name | - | Create new Category with character special | 1 | sample!@#$%^^& | + | Create new Category with character special | 1 | sample!@#$%^^& | | Create new Category with only character numeric | 2 | 32425325 | | Create new Category with only character special | 3 | @$@$#@% | | Create new Category with normal character | 4 | sample | | Create new Category with short name | 5 | s | | Create new Category with long name | 6 | Prueba de Creacion de nuevo categoria con nombre largo | + | Create new Category with long name | 7 | Right Category | -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" @@ -62,39 +57,43 @@ Scenario: Get list of Categories And the response has 7 records -Scenario: Create Category with same name - Given POST this data: - """ + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario: Create Category with same name twice + Given POST this data: + """ { "cat_name": "sample" } """ - And I request "project/category" - Then the response status code should be 400 - And the response status message should have the following text "exist" + And I request "project/category" + Then the response status code should be 400 + And the response status message should have the following text "exist" -Scenario Outline: Update the Category created in this script + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario Outline: Update the Categories created in this script Given PUT this data: - """ + """ { "cat_name": "" } """ - And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - - Examples: + And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + Examples: | test_description | cat_uid_number | cat_name | - | Update Category | 1 | UPDATE sample!@#$%^^& | + | Update Category | 1 | UPDATE sample!@#$%^^& | | Update Category | 2 | UPDATE 32425325 | -Scenario Outline: Update the Category putting the same name + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario Outline: Update the Category putting the same name Given PUT this data: """ { @@ -104,64 +103,57 @@ Scenario Outline: Update the Category putting the same name And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" Then the response status code should be 400 And the response status message should have the following text "exist" - - Examples: + Examples: | test_description | cat_uid_number | cat_name | - | Update Category | 5 | sample | - + | Update Category | 5 | sample | - -Scenario Outline: Get a Category specific + # GET /api/1.0/{workspace}/project/categories + # Get an specific Category + Scenario Outline: Get an specific Category Given I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" And the "cat_name" property equals "" - And the "cat_total_processes" property equals + And the "cat_total_processes" property equals "" - Examples: + Examples: | cat_uid_number | cat_name | cat_total_processes | - | 1 | UPDATE sample!@#$%^^& | 0 | + | 1 | UPDATE sample!@#$%^^& | 0 | | 2 | UPDATE 32425325 | 0 | -Scenario Outline: Delete the Category created previously in this script + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario Outline: Delete the Category created previously in this script Given that I want to delete a resource with the key "cat_uid" stored in session array as variable "cat_uid_" - And I request "project/category" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" + And I request "project/category" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" - Examples: - - | cat_uid_number | - | 1 | - | 2 | - | 3 | - | 4 | - | 5 | - | 6 | + Examples: + | cat_uid_number | + | 1 | + | 2 | + | 3 | + | 4 | + | 5 | + | 6 | + | 7 | -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 1 records - -Scenario: Get a Category specific - Given I request "project/category/4177095085330818c324501061677193" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the "cat_uid" property equals "4177095085330818c324501061677193" - And the "cat_name" property equals "Category Cases Lists" - And the "cat_total_processes" property equals 6 \ No newline at end of file + And the response has 0 records \ No newline at end of file diff --git a/features/backend/admin_setup/category/negative_tests_category.feature b/features/backend/admin_setup/category/negative_tests_category.feature index a79411105..0c9420dca 100644 --- a/features/backend/admin_setup/category/negative_tests_category.feature +++ b/features/backend/admin_setup/category/negative_tests_category.feature @@ -2,11 +2,13 @@ Feature: Process Category Negative Tests -Background: + Background: Given that I have a valid access_token -Scenario Outline: Create a new Categories (Negative Test) + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario Outline: Create a new Category (Negative Test) Given POST this data: """ { @@ -17,15 +19,15 @@ Scenario Outline: Create a new Categories (Negative Test) Then the response status code should be And the response status message should have the following text "" - Examples: - + Examples: | test_description | cat_name | error_code | error_message | - | without name | | 400 | cat_name | + | without name | | 400 | cat_name | - -Scenario: Delete the Category when it is assigned to a project "Category Cases Lists" + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario: Delete the Category when it is assigned to a project "Category Cases Lists" Given that I want to delete a "Category" And I request "project/category/4177095085330818c324501061677193" Then the response status code should be 400 - And the response status message should have the following text "cannot be deleted" \ No newline at end of file + And the response status message should have the following text "does not exist" \ No newline at end of file diff --git a/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature similarity index 75% rename from features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak rename to features/backend/oauth/authorization_code/main_tests_authorization_code.feature index 71a8b4e51..759367631 100644 --- a/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak +++ b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature @@ -1,10 +1,12 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Authorization Code -Requirements: - a workspace with open session and installed application + Requirements: + a workspace with open session and installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + # OAUTH /en/neoclassic/oauth2 + # In order to generate a new token create a new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET in order to generate a new token Given OAUTH register an application """ { @@ -15,15 +17,16 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET "applicationNumber":"" } """ - Examples: + Examples: | Description | application_number | application_name | application_description | application_website | application_redirectUri | - | Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | - | Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | - + | Create token normal | 1 | Behat1 | Behat1 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | + | Create token normal | 2 | Behat2 | Behat2 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | -#Endpoint para verificar el correcto funcionamiento del token generado en este script -Scenario Outline: Get the Output Documents List both process + + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar el correcto funcionamiento del token generado en este script + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 200 @@ -32,27 +35,28 @@ Scenario Outline: Get the Output Documents List both process And the type is "array" And the response has records And the "out_doc_title" property in row 0 equals "" - - Examples: + Examples: | test_description | project | records | out_doc_title | application_number | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | -Scenario Outline: Get the Output Documents List both process (without valid token) + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar el correcto funcionamiento del token generado en este script + Scenario Outline: Get the Output Documents List both process (without valid token) Given I request "project//output-documents" Then the response status code should be 401 - - Examples: - | test_description | project | records | out_doc_title | application_number | + Examples: + | test_description | project | records | out_doc_title | application_number | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | -#Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script + # POST /en/neoclassic/oauth2/access_token/expire + # Endpoint para hacer que expire los token creados en este script + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -60,30 +64,30 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + Examples: | Description | application_number | | Expire token 1 | 1 | | Expire token 2 | 2 | - -#Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process + + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar que el token haya expirado + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | -#Grant type Refresh Token -Scenario Outline: Refresh token + # POST /en/neoclassic/oauth2/refresh_token_ + # Grant type Refresh Token + Scenario Outline: Refresh token Given POST this data: """ { @@ -99,16 +103,16 @@ Scenario Outline: Refresh token And store "expires_in" in session array as variable "expires_in_" And store "token_type" in session array as variable "token_type_" And store "scope" in session array as variable "scope_" - - Examples: + Examples: | Description | grant_number | refresh_token_number | | Create token normal | 1 | 3 | | Create token normal | 2 | 4 | - -#Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script -Scenario Outline: Get the Output Documents List both process + + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 200 @@ -117,17 +121,16 @@ Scenario Outline: Get the Output Documents List both process And the type is "array" And the response has records And the "out_doc_title" property in row 0 equals "" - - Examples: + Examples: | test_description | project | records | out_doc_title | application_number | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 3 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | -#Endpoint para borrar el token creado en este script - -Scenario Outline: Delete all tokens created previously in this script + # DELETE /en/neoclassic/oauth2 + # Endpoint para borrar el token creado en este script + Scenario Outline: Delete all tokens created previously in this script Given that I want to delete a resource with the key "access_token_" stored in session array And I request "oauth2" And the content type is "application/json" @@ -135,24 +138,23 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: - + Examples: | application_number | | 1 | | 2 | | 3 | | 4 | - -#Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar que el token ya no existe + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | diff --git a/features/backend/oauth/authorization_code/main_tests_client_credentials.feature b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature index 6456645d0..46964af1d 100644 --- a/features/backend/oauth/authorization_code/main_tests_client_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Client Credentials Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Given POST this data: """ { @@ -19,28 +19,27 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET And store "access_token" in session array as variable "access_token_" And store "expires_in" in session array as variable "expires_in_" And store "token_type" in session array as variable "token_type_" - - Examples: + + Examples: | Description | grant_number | grant_type | | Create token normal | 1 | client_credentials | | Create token normal | 2 | client_credentials | - + #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Given that I assign an access token from session variable "access_token_" And I request "cases" Then the response status code should be 400 And the response charset is "UTF-8" - - Examples: + Examples: | Description | grant_number | | Create token normal | 1 | | Create token normal | 2 | #Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -48,13 +47,13 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -62,38 +61,38 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 2 | 2 | - + #Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | #Endpoint para borrar el token creado en este script -Scenario Outline: Delete all tokens created previously in this script + Scenario Outline: Delete all tokens created previously in this script Given that I want to delete a resource with the key "access_token_" stored in session array And I request "oauth2" And the content type is "application/json" @@ -101,31 +100,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | diff --git a/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature similarity index 86% rename from features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak rename to features/backend/oauth/authorization_code/main_tests_implicit_grant.feature index bee8d9386..bbfe5cf94 100644 --- a/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak +++ b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Implicit Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create a new implicit token through CLIENT_ID and CLIENT_SECRET Given OAUTH request implicit grant """ { @@ -14,14 +14,14 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET "implicit_grant_number":"" } """ - Examples: + Examples: | Description | implicit_grant_number | response_type | client_id | scope | | Create token normal | 1 | token | x-pm-local-client | * | | Create token normal | 2 | token | x-pm-local-client | * | - + #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Given that I assign an access token from session variable "access_token_" And I request "cases" Then the response status code should be 200 @@ -29,13 +29,13 @@ Scenario Outline: Returns a list of the cases for the logged in user (Inbox) And the type is "array" And the response has 14 records - Examples: + Examples: | Description | implicit_grant_number | | Create token normal | 1 | | Create token normal | 2 | #Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -43,13 +43,13 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -57,38 +57,38 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 2 | 2 | - + #Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | #Endpoint para borrar el token creado en este script -Scenario Outline: Delete all tokens created previously in this script + Scenario Outline: Delete all tokens created previously in this script Given that I want to delete a resource with the key "access_token_" stored in session array And I request "oauth2" And the content type is "application/json" @@ -96,31 +96,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | diff --git a/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature index e928cc608..e795d5da0 100644 --- a/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Resources Owner Password Credential Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Given POST this data: """ { @@ -26,14 +26,14 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET And store "refresh_token" in session array as variable "refresh_token_" - Examples: + Examples: | Description | grant_number | grant_type | username | password | scope | | Create token normal | 1 | password | amy | sample | * | | Create token normal | 2 | password | admin | sample123* | * | - + #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Given that I assign an access token from session variable "access_token_" And I request "cases" Then the response status code should be 200 @@ -41,14 +41,14 @@ Scenario Outline: Returns a list of the cases for the logged in user (Inbox) And the type is "array" And the response has records - Examples: + Examples: | Description | grant_number | records | | Create token normal | 1 | 4 | | Create token normal | 2 | 14 | #Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -56,13 +56,13 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -70,38 +70,38 @@ Scenario Outline: Expire token created in this script """ And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" Then the response status code should be 200 - - Examples: + + Examples: | Description | application_number | | Expire token 2 | 2 | - + #Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | #Endpoint para borrar el token creado en este script -Scenario Outline: Delete all tokens created previously in this script + Scenario Outline: Delete all tokens created previously in this script Given that I want to delete a resource with the key "access_token_" stored in session array And I request "oauth2" And the content type is "application/json" @@ -109,31 +109,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - -Scenario Outline: Get the Output Documents List both process + + Scenario Outline: Get the Output Documents List both process Given that I assign an access token from session variable "access_token_" And I request "project//output-documents" Then the response status code should be 401 And the response status message should have the following text "" - - Examples: + + Examples: | test_description | project | records | out_doc_title | application_number | error_message | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | diff --git a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature index 0ff969058..43f926f73 100644 --- a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature +++ b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature @@ -11,7 +11,7 @@ Feature: DataBase Connections Main Tests Mysql # GET /api/1.0/{workspace}/project//database-connections - # Get list DataBase| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description | Connections + # Get list DataBase Scenario Outline: Get the DataBase Connections List when there are exactly zero DataBase Connections Given I request "project//database-connections" Then the response status code should be 200 diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 87c1d4f43..a6c597572 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -2162,13 +2162,11 @@ class RestContext extends BehatContext throw new Exception('Bad credentials'); } - //print ""; if (curl_error($ch)) { throw new Exception(curl_error($ch)); } - // Read the session saved in the cookie file if(!file_exists($cookie_file)){ @@ -2202,20 +2200,21 @@ class RestContext extends BehatContext } $parts = parse_url($newurl); - parse_str($parts['fragment'], $fragment); - //print_r($fragment); - // json_decode(json) - $response=json_decode($answer); - if (file_exists("session.data")) { $sessionData = json_decode(file_get_contents("session.data")); } else { $sessionData = new StdClass(); } + + //print_r($fragment); + // json_decode(json) + //$response=json_decode($answer); + parse_str($parts['fragment'], $fragment); foreach($fragment as $key => $varValue){ $sessionVarName=$key."_".$implicit_grant_number; $sessionData->$sessionVarName = $varValue; } + //print_r($sessionData); file_put_contents("session.data", json_encode($sessionData)); //print_r("\nRegister application:\n".$answer."\n$oauth_authorization_url?response_type=$response_type&client_id=$client_id&scope=$scope\n"); diff --git a/gulliver/bin/tasks/pakeGulliver.php b/gulliver/bin/tasks/pakeGulliver.php index ce6721b17..4160cc929 100755 --- a/gulliver/bin/tasks/pakeGulliver.php +++ b/gulliver/bin/tasks/pakeGulliver.php @@ -69,8 +69,10 @@ pake_task('workspace-backup', 'project_exists'); pake_desc("restore a previously backed-up workspace\n args: [-o|--overwrite] "); pake_task('workspace-restore', 'project_exists'); +/*----------------------------------********---------------------------------*/ pake_desc("check standard code\n args: "); pake_task('check-standard-code', 'project_exists' ); +/*----------------------------------********---------------------------------*/ /** * Function run_version diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index 4ae6215e0..1b5f7e510 100755 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -186,6 +186,7 @@ EOT CLI::taskArg("workspace-name", true, true); CLI::taskRun("run_database_generate_self_service_by_value"); +/*----------------------------------********---------------------------------*/ CLI::taskName("check-workspace-disabled-code"); CLI::taskDescription(<<getMessage()) . "\n"; } } - +/*----------------------------------********---------------------------------*/ function run_check_workspace_disabled_code($args, $opts) { try { @@ -630,4 +632,4 @@ function run_check_workspace_disabled_code($args, $opts) echo CLI::error($e->getMessage()) . "\n"; } } - +/*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 446112987..4473db067 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -923,6 +923,7 @@ class Applications $stepItem['title'] = $oDocument->getDynTitle(); $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT"; + $stepItem['version'] = $oDocument->getDynVersion(); break; case 'OUTPUT_DOCUMENT': $oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() ); diff --git a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js index 3ecda0e5e..c00f8e6aa 100644 --- a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js +++ b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js @@ -46,21 +46,6 @@ $(window).load(function () { var form = document.getElementsByTagName("form")[0]; - var el = form.elements; - var dt = data.items[0].items; - for (var i = 0; i < dt.length; i++) { - var dr = dt[i]; - for (var j = 0; j < dr.length; j++) { - if (dr[j].name) { - for (var k = 0; k < el.length; k++) { - if (el[k].name === dr[j].name) { - el[k].name = "form[" + dr[j].name + "]"; - } - } - } - } - } - var type = document.createElement("input"); type.type = "hidden"; type.name = "TYPE"; diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index b36cc3cf9..a042bc107 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1424,11 +1424,12 @@ class Cases * @access public * @param string $app_uid, Uid for case * @param array $app_data, Data for case variables + * @param string $dyn_uid, Uid for dynaform * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia */ - public function setCaseVariables($app_uid, $app_data) + public function setCaseVariables($app_uid, $app_data, $dyn_uid = null) { Validator::isString($app_uid, '$app_uid'); Validator::appUid($app_uid, '$app_uid'); @@ -1436,7 +1437,18 @@ class Cases $case = new \Cases(); $fields = $case->loadCase($app_uid); - $data['APP_DATA'] = array_merge($fields['APP_DATA'], $app_data); + $_POST['form'] = $app_data; + + if (!is_null($dyn_uid)) { + $oDynaform = \DynaformPeer::retrieveByPK($dyn_uid); + + if ($oDynaform->getDynVersion() < 2) { + $oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM ); + $oForm->validatePost(); + } + } + + $data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']); $case->updateCase($app_uid, $data); } @@ -1905,5 +1917,57 @@ class Cases throw $e; } } -} + /** + * Put execute triggers + * + * @access public + * @param string $app_uid , Uid for case + * @param int $del_index , Index for case + * @param string $obj_type , Index for case + * @param string $obj_uid , Index for case + * + * @copyright Colosa - Bolivia + */ + public function putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid) + { + Validator::isString($app_uid, '$app_uid'); + Validator::appUid($app_uid, '$app_uid'); + Validator::isInteger($del_index, '$del_index'); + + $oCase = new \Cases(); + $aField = $oCase->loadCase($app_uid, $del_index); + $tas_uid = $aField["TAS_UID"]; + + $task = new \Tasks(); + $aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]); + $aField = $oCase->updateCase($app_uid, $aField); + } + + /** + * Get Steps evaluate + * + * @access public + * @param string $app_uid, Uid for case + * @param int $del_index , Index for case + * @return array + * + * @copyright Colosa - Bolivia + */ + public function getSteps($app_uid, $del_index) + { + Validator::isString($app_uid, '$app_uid'); + Validator::appUid($app_uid, '$app_uid'); + Validator::isInteger($del_index, '$del_index'); + + $oCase = new \Cases(); + $aCaseField = $oCase->loadCase($app_uid, $del_index); + $tas_uid = $aCaseField["TAS_UID"]; + $pro_uid = $aCaseField["PRO_UID"]; + + $oApplication = new \Applications(); + $aField = $oApplication->getSteps($app_uid, $del_index, $tas_uid, $pro_uid); + + return $aField; + } +} diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php index d253dd5ef..f73506687 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php @@ -610,6 +610,7 @@ class Variable $variableSql = ""; $sqlLimit = ""; $variableSqlLimit = ""; + $sqlConditionLike = ""; $criteria = new \Criteria("workflow"); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index e27f6017a..2d16625b9 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -838,17 +838,18 @@ class Cases extends Api * * @param string $app_uid {@min 1}{@max 32} * @param array $request_data + * @param string $dyn_uid {@from path} * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia * * @url PUT /:app_uid/variable */ - public function doPutCaseVariables($app_uid, $request_data) + public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '') { try { $cases = new \ProcessMaker\BusinessModel\Cases(); - $cases->setCaseVariables($app_uid, $request_data); + $cases->setCaseVariables($app_uid, $request_data, $dyn_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } @@ -994,5 +995,48 @@ class Cases extends Api throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); } } + + /** + * Execute triggers + * + * @param string $app_uid {@min 1}{@max 32} + * @param int $del_index {@from body} + * @param string $obj_type {@from body} + * @param string $obj_uid {@from body} + * + * @copyright Colosa - Bolivia + * + * @url PUT /:app_uid/execute-triggers + */ + public function doPutExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid) + { + try { + $cases = new \ProcessMaker\BusinessModel\Cases(); + $cases->putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url GET /:app_uid/:del_index/steps + * + * @param string $app_uid {@min 32}{@max 32} + * @param int $del_index + * + */ + public function doGetSteps($app_uid, $del_index) + { + try { + $case = new \ProcessMaker\BusinessModel\Cases(); + $case->setFormatFieldNameInUppercase(false); + + $response = $case->getSteps($app_uid, $del_index); + + return $response; + } catch (\Exception $e) { + throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); + } + } } diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 1bb60caac..c245247f9 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -132,10 +132,10 @@ -
  • +
  • diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index 44b1f225f..fc88597d1 100755 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -967,7 +967,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { items.push({ id: 'REP_TAB_NAME', - fieldLabel: _("ID_TABLE_NAME") + ' ('+_("ID_AUTO_PREFIX") + ' "PMT")', + fieldLabel: _("ID_TABLE_NAME") + ' ('+_("ID_AUTO_PREFIX") + ' "PMT_")', xtype:'textfield', emptyText: _("ID_SET_A_TABLE_NAME"), width: 250,