Were added some adjustments in order to make the tests are independents.

This commit is contained in:
m3ik0
2015-01-06 18:02:04 -04:00
parent b91aa7a820
commit 869896ae79
3 changed files with 127 additions and 109 deletions

View File

@@ -1,31 +1,27 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Process Category Feature: Process Category
Requirements: 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 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" Given I request "project/categories"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records And the response has 0 records
Scenario: Get a Category specific # POST /api/1.0/{workspace}/project/category
Given I request "project/category/4177095085330818c324501061677193" # Create a new Category
Then the response status code should be 200 Scenario: Create a new Category
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario: Create a new Categories
Given POST this data: Given POST this data:
""" """
{ {
@@ -40,33 +36,61 @@ Scenario: Create a new Categories
And store "cat_uid" in session array as variable "cat_uid" 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" Given I request "project/categories"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" 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: Given PUT this data:
""" """
{ {
"cat_name": "Name Updated" "cat_name": "Name Updated"
} }
""" """
And that I want to update a resource with the key "cat_uid" stored in session array And that I want to update a resource with the key "cat_uid" stored in session array
And I request "project/category" And I request "project/category"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
Scenario: Delete the Category created previously in this script # GET /api/1.0/{workspace}/project/category/<category-id>
# 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 Given that I want to delete a resource with the key "cat_uid" stored in session array
And I request "project/category" And I request "project/category"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" 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

View File

@@ -1,34 +1,27 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Process Category Main Test Feature: Process Category Main Test
Requirements: 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 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" Given I request "project/categories"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has 1 records And the response has 0 records
Scenario: Get a Category specific # POST /api/1.0/{workspace}/project/category
Given I request "project/category/4177095085330818c324501061677193" # Create a new Category
Then the response status code should be 200 Scenario Outline: Create new Categories
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
Given POST this data: Given POST this data:
""" """
{ {
@@ -42,8 +35,7 @@ Scenario Outline: Create a new Categories
And the type is "object" And the type is "object"
And store "cat_uid" in session array as variable "cat_uid_<cat_uid_number>" And store "cat_uid" in session array as variable "cat_uid_<cat_uid_number>"
Examples: Examples:
| test_description | cat_uid_number | cat_name | | 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 numeric | 2 | 32425325 |
@@ -51,9 +43,12 @@ Scenario Outline: Create a new Categories
| Create new Category with normal character | 4 | sample | | Create new Category with normal character | 4 | sample |
| Create new Category with short name | 5 | s | | 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 | 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" Given I request "project/categories"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
@@ -62,39 +57,43 @@ Scenario: Get list of Categories
And the response has 7 records And the response has 7 records
Scenario: Create Category with same name # POST /api/1.0/{workspace}/project/category
Given POST this data: # Create a new Category
""" Scenario: Create Category with same name twice
Given POST this data:
"""
{ {
"cat_name": "sample" "cat_name": "sample"
} }
""" """
And I request "project/category" And I request "project/category"
Then the response status code should be 400 Then the response status code should be 400
And the response status message should have the following text "exist" 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: Given PUT this data:
""" """
{ {
"cat_name": "<cat_name>" "cat_name": "<cat_name>"
} }
""" """
And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>" And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
Examples:
Examples:
| test_description | cat_uid_number | cat_name | | test_description | cat_uid_number | cat_name |
| Update Category | 1 | UPDATE sample!@#$%^^& | | Update Category | 1 | UPDATE sample!@#$%^^& |
| Update Category | 2 | UPDATE 32425325 | | 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: Given PUT this data:
""" """
{ {
@@ -105,63 +104,56 @@ Scenario Outline: Update the Category putting the same name
Then the response status code should be 400 Then the response status code should be 400
And the response status message should have the following text "exist" And the response status message should have the following text "exist"
Examples: Examples:
| test_description | cat_uid_number | cat_name | | test_description | cat_uid_number | cat_name |
| Update Category | 5 | sample | | Update Category | 5 | sample |
# GET /api/1.0/{workspace}/project/categories
# Get an specific Category
Scenario Outline: Get a Category specific 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_<cat_uid_number>" Given I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the "cat_name" property equals "<cat_name>" And the "cat_name" property equals "<cat_name>"
And the "cat_total_processes" property equals <cat_total_processes> And the "cat_total_processes" property equals "<cat_total_processes>"
Examples: Examples:
| cat_uid_number | cat_name | cat_total_processes | | cat_uid_number | cat_name | cat_total_processes |
| 1 | UPDATE sample!@#$%^^& | 0 | | 1 | UPDATE sample!@#$%^^& | 0 |
| 2 | UPDATE 32425325 | 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_<cat_uid_number>" Given that I want to delete a resource with the key "cat_uid" stored in session array as variable "cat_uid_<cat_uid_number>"
And I request "project/category" And I request "project/category"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
Examples: Examples:
| cat_uid_number |
| cat_uid_number | | 1 |
| 1 | | 2 |
| 2 | | 3 |
| 3 | | 4 |
| 4 | | 5 |
| 5 | | 6 |
| 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" Given I request "project/categories"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" 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

View File

@@ -2,11 +2,13 @@
Feature: Process Category Negative Tests Feature: Process Category Negative Tests
Background: Background:
Given that I have a valid access_token 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: Given POST this data:
""" """
{ {
@@ -17,15 +19,15 @@ Scenario Outline: Create a new Categories (Negative Test)
Then the response status code should be <error_code> Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | cat_name | error_code | error_message | | test_description | cat_name | error_code | error_message |
| without name | | 400 | cat_name | | without name | | 400 | cat_name |
# DELETE /api/1.0/{workspace}/project/category
Scenario: Delete the Category when it is assigned to a project "Category Cases Lists" # 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" Given that I want to delete a "Category"
And I request "project/category/4177095085330818c324501061677193" And I request "project/category/4177095085330818c324501061677193"
Then the response status code should be 400 Then the response status code should be 400
And the response status message should have the following text "cannot be deleted" And the response status message should have the following text "does not exist"