From 869896ae79e784499d6c49b15c95362dd8ebd0c3 Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Tue, 6 Jan 2015 18:02:04 -0400 Subject: [PATCH] Were added some adjustments in order to make the tests are independents. --- .../category/basic_sequence_category.feature | 80 ++++++---- .../category/main_tests_category.feature | 138 +++++++++--------- .../category/negative_tests_category.feature | 18 ++- 3 files changed, 127 insertions(+), 109 deletions(-) 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