From 3a0d3822b5e068d273b400f8ee7173872dd8076e Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Tue, 10 Jun 2014 10:25:33 -0400 Subject: [PATCH] Adicion de nuevos escenarios a los features calendar y process category --- .../calendar/main_tests_calendar.feature | 53 ++++++++++++++++--- .../calendar/negative_tests_calendar.feature | 24 ++++++++- .../category/main_tests_category.feature | 50 +++++++++++++---- 3 files changed, 109 insertions(+), 18 deletions(-) diff --git a/features/backend/admin_setup/calendar/main_tests_calendar.feature b/features/backend/admin_setup/calendar/main_tests_calendar.feature index da01566d4..a52b596b4 100644 --- a/features/backend/admin_setup/calendar/main_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/main_tests_calendar.feature @@ -15,7 +15,7 @@ Scenario: List of calendar And the response has 2 records -Scenario: Get a single calendar +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" @@ -25,6 +25,16 @@ Scenario: Get a single calendar 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" + Given I request "calendar/00000000000000000000000000000001" + 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 "00000000000000000000000000000001" + And the "cal_name" property equals "Default Calendar" + And the "cal_description" property equals "Default Calendar" + Scenario Outline: Create a new Calendars Given POST this data: @@ -52,12 +62,12 @@ Scenario Outline: Create a new Calendars 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 | - | Create calendar with name long | 3 | Calendar 3 | Prueba de Creacion de Calendario 3 | - | Create calendar with special character | 4 | Calendar 4 !@#$%^& | Prueba de Creacion de Calendario 4 | - + | 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 Given POST this data: @@ -204,6 +214,35 @@ Scenario Outline: Update the calendars and then check if the values had changed | 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 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" diff --git a/features/backend/admin_setup/calendar/negative_tests_calendar.feature b/features/backend/admin_setup/calendar/negative_tests_calendar.feature index 6592349bd..ae2cc09c6 100644 --- a/features/backend/admin_setup/calendar/negative_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/negative_tests_calendar.feature @@ -140,4 +140,26 @@ Scenario: Create a new Calendars (wrong date_end) """ And I request "calendar" Then the response status code should be 400 - And the response status message should have the following text "date_end" \ No newline at end of file + And the response status message should have the following text "date_end" + + +Scenario: Create a new Calendars (with work days less than 3) + Given POST this data: + """ + { + "cal_name": "Sample Calendar", + "cal_description": "Creacion de Calendar 400", + "cal_work_days": [1,2], + "cal_work_hour": [ + {"day": 0, "hour_start": "00:00", "hour_end": "00:00"}, + {"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"} + ] + } + """ + And I request "calendar" + Then the response status code should be 400 + And the response status message should have the following text "least 3 Working Days" \ 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 f8bb9a60b..1e095bab0 100644 --- a/features/backend/admin_setup/category/main_tests_category.feature +++ b/features/backend/admin_setup/category/main_tests_category.feature @@ -44,12 +44,13 @@ Scenario Outline: Create a new Categories Examples: - | test_description | cat_uid_number | cat_name | - | Create new Category with character special | 1 | sample!@#$%^^& | - | Create new Category with only character numeric | 2 | 32425325 | - | Create new Category with only character special | 3 | @$@$#@% | - | Create new Category with normal character | 4 | sample | - + | test_description | cat_uid_number | cat_name | + | Create new Category with character special | 1 | sample!@#$%^^& | + | Create new Category with only character numeric | 2 | 32425325 | + | Create new Category with only character special | 3 | @$@$#@% | + | Create new Category with normal character | 4 | sample | + | Create new Category with short name | 5 | s | + | Create new Category with long name | 6 | Prueba de Creacion de nuevo categoria con nombre largo | Scenario: Get list of Categories @@ -58,7 +59,7 @@ Scenario: Get list of Categories And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 5 records + And the response has 7 records Scenario: Create Category with same name @@ -88,11 +89,30 @@ Scenario Outline: Update the Category created in this script Examples: - | test_description | cat_uid_number | cat_name | - | Update Category | 1 | UPDATE sample!@#$%^^& | - | Update Category | 2 | UPDATE 32425325 | + | test_description | cat_uid_number | cat_name | + | Update Category | 1 | UPDATE sample!@#$%^^& | + | Update Category | 2 | UPDATE 32425325 | + + +Scenario Outline: Update the Category putting the same name + 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_" + Then the response status code should be 400 + And the response status message should have the following text "Duplicate Process Category" + + Examples: + + | test_description | cat_uid_number | cat_name | + | Update Category | 5 | sample | + + Scenario Outline: Get a Category specific 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 @@ -124,8 +144,18 @@ Scenario Outline: Delete the Category created previously in this script | 2 | | 3 | | 4 | + | 5 | + | 6 | +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