Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Daniel Rojas
2014-06-12 08:42:17 -04:00
11 changed files with 562 additions and 254 deletions

View File

@@ -15,7 +15,7 @@ Scenario: List of calendar
And the response has 2 records And the response has 2 records
Scenario: Get a single calendar Scenario: Get a single calendar "Test Process"
Given I request "calendar/14606161052f50839307899033145440" Given I request "calendar/14606161052f50839307899033145440"
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"
@@ -25,6 +25,16 @@ Scenario: Get a single calendar
And the "cal_name" property equals "Test Process" And the "cal_name" property equals "Test Process"
And the "cal_description" property equals "Calendar para el feature 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 Scenario Outline: Create a new Calendars
Given POST this data: Given POST this data:
@@ -52,12 +62,12 @@ Scenario Outline: Create a new Calendars
Examples: Examples:
| test_description | cal_uid_number | cal_name | cal_description | | test_description | cal_uid_number | cal_name | cal_description |
| Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | | 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 short name | 2 | C | Prueba de Creacion de Calendario 2 |
| Create calendar with name long | 3 | Calendar 3 | Prueba de Creacion de Calendario 3 | | 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 | | 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 Scenario Outline: Create a new Calendar with parameter cal_work_days diferent
Given POST this data: 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 | | 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_name>",
"cal_description": "<cal_description>",
"cal_work_days": [1,2,3,4,5],
"cal_status": "<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_<cal_uid_number>"
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 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_<cal_uid_number>" Given that I want to get a resource with the key "cal_uid" stored in session array as variable "cal_uid_<cal_uid_number>"
And I request "calendar" And I request "calendar"

View File

@@ -140,4 +140,26 @@ Scenario: Create a new Calendars (wrong date_end)
""" """
And I request "calendar" And I request "calendar"
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 "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)
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"

View File

@@ -44,12 +44,13 @@ Scenario Outline: Create a new Categories
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 |
| Create new Category with only character special | 3 | @$@$#@% | | Create new Category with only character special | 3 | @$@$#@% |
| 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 long name | 6 | Prueba de Creacion de nuevo categoria con nombre largo |
Scenario: Get list of Categories Scenario: Get list of Categories
@@ -58,7 +59,7 @@ Scenario: Get list of Categories
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 5 records And the response has 7 records
Scenario: Create Category with same name Scenario: Create Category with same name
@@ -88,11 +89,30 @@ Scenario Outline: Update the Category created in this script
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
Given PUT this data:
"""
{
"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>"
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 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_<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
@@ -124,8 +144,18 @@ Scenario Outline: Delete the Category created previously in this script
| 2 | | 2 |
| 3 | | 3 |
| 4 | | 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 Scenario: Get a Category specific
Given I request "project/category/4177095085330818c324501061677193" Given I request "project/category/4177095085330818c324501061677193"
Then the response status code should be 200 Then the response status code should be 200

View File

@@ -7,253 +7,277 @@ Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: List all Departaments in the workspace when exactly are 15 departaments created Scenario: List all Departaments in the workspace when exactly are 15 departaments created
Given I request "department" Given I request "department"
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 "array" And the type is "array"
And the response has 15 record And the response has 15 record
Scenario: Get a single department of de Sales Division department Scenario: Get a single department of de Sales Division department
Given I request "department/12921473252d567506e6e63079240767" Given I request "department/12921473252d567506e6e63079240767"
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"
And the "dep_uid" property equals "12921473252d567506e6e63079240767" And the "dep_uid" property equals "12921473252d567506e6e63079240767"
And the "dep_parent" property equals "" And the "dep_parent" property equals ""
And the "dep_title" property equals "Sales Division" And the "dep_title" property equals "Sales Division"
And the "dep_status" property equals "ACTIVE" And the "dep_status" property equals "ACTIVE"
And the "dep_manager" property equals "38102442252d5671a629009013495090" And the "dep_manager" property equals "38102442252d5671a629009013495090"
And the "dep_ldap_dn" property equals "" And the "dep_ldap_dn" property equals ""
And the "dep_last" property equals "0" And the "dep_last" property equals "0"
And the "dep_manager_username" property equals "dylan" And the "dep_manager_username" property equals "dylan"
And the "dep_manager_firstname" property equals "Dylan" And the "dep_manager_firstname" property equals "Dylan"
And the "dep_manager_lastname" property equals "Burns" And the "dep_manager_lastname" property equals "Burns"
And the "has_children" property equals "0" And the "has_children" property equals "0"
Scenario: Get a List of Assigned User (Department: Sales Division) Scenario: Get a List of Assigned User (Department: Sales Division)
Given I request "department/12921473252d567506e6e63079240767/assigned-user" Given I request "department/12921473252d567506e6e63079240767/assigned-user"
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 "array" And the type is "array"
And the response has 4 record And the response has 4 record
And that "usr_username" is set to "joseph"
And that "usr_username" is set to "jacob"
And that "usr_username" is set to "dylan"
And that "usr_username" is set to "joshua"
Scenario Outline: Create a new departments in the workspace Scenario Outline: Create a new departments in the workspace
Given POST this data: Given POST this data:
""" """
{ {
"dep_title" : "<dep_title>", "dep_title" : "<dep_title>",
"dep_parent" : "<dep_parent>", "dep_parent" : "<dep_parent>",
"dep_status" : "<dep_status>" "dep_status" : "<dep_status>"
} }
""" """
And I request "department" And I request "department"
Then the response status code should be 201 Then the response status code should be 201
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 "object" And the type is "object"
And store "dep_uid" in session array as variable "dep_uid_<dep_uid_number>" And store "dep_uid" in session array as variable "dep_uid_<dep_uid_number>"
Examples: Examples:
| test_description | dep_uid_number | dep_title | dep_parent | dep_status | | test_description | dep_uid_number | dep_title | dep_parent | dep_status |
| Created a department padre with status active | 1 | Department A | | ACTIVE | | Created a department padre with status active | 1 | Department A | | ACTIVE |
| Created a department hijo with status active | 2 | Department B | 28036037252d56752770585009591640 | ACTIVE | | Created a department hijo with status active | 2 | Department B | 28036037252d56752770585009591640 | ACTIVE |
| Created a department padre with status inactive | 3 | Department C | | INACTIVE | | Created a department padre with status inactive | 3 | Department C | | INACTIVE |
| Created a department hijo with status inactive | 4 | Department D | 28036037252d56752770585009591640 | INACTIVE | | Created a department hijo with status inactive | 4 | Department D | 28036037252d56752770585009591640 | INACTIVE |
| Created a department with character special | 5 | Department E!@#$%^& | | ACTIVE | | Created a department with character special | 5 | Department E!@#$%^& | | ACTIVE |
Scenario: Create a department with same name Scenario: Create a department with same name
Given POST this data: Given POST this data:
""" """
{ {
"dep_title" : "Department A", "dep_title" : "Department A",
"dep_parent" : "", "dep_parent" : "",
"dep_status" : "ACTIVE" "dep_status" : "ACTIVE"
} }
""" """
And I request "department" And I request "department"
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: List all Departaments in the workspace when exactly are 20 departaments created Scenario: List all Departaments in the workspace when exactly are 18 departaments created
Given I request "department" Given I request "department"
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 "array" And the type is "array"
And the response has 18 record And the response has 18 record
Scenario Outline: Update a department created in this script Scenario Outline: Update a department created in this script
Given PUT this data: Given PUT this data:
""" """
{ {
"dep_title" : "<dep_title>", "dep_title" : "<dep_title>",
"dep_status" : "<dep_status>" "dep_status" : "<dep_status>"
} }
""" """
And that I want to update a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" And that I want to update a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
And I request "department" And I request "department"
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 "object" And the type is "object"
Examples: Examples:
| test_description | dep_uid_number | dep_title | dep_status | | test_description | dep_uid_number | dep_title | dep_status |
| Update of field title and status of department | 1 | Department A UPDATE | INACTIVE | | Update of field title and status of department | 1 | Department A UPDATE | INACTIVE |
| Update of field title and status of department | 2 | Department B UPDATE | ACTIVE | | Update of field title and status of department | 2 | Department B UPDATE | ACTIVE |
Scenario Outline: Get a single department after update of the department created of this script
Given that I want to get a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
And I request "department"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that "dep_title" is set to "<dep_title>"
And that "dep_status" is set to "<dep_status>"
Examples: Scenario Outline: Update a department putting the same name of a department created in this script
Given PUT this data:
"""
{
| dep_uid_number | dep_title | dep_status | "dep_title" : "<dep_title>",
| 1 | Department A UPDATE | INACTIVE | "dep_status" : "<dep_status>"
| 3 | Department B UPDATE | ACTIVE |
}
"""
And that I want to update a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
And I request "department"
Then the response status code should be 400
And the response status message should have the following text "exist"
Examples:
| dep_uid_number | dep_title | dep_status |
| 5 | Department C | INACTIVE |
Scenario Outline: Assign user to department created in this script Scenario Outline: Get a single department after update of the department created of this script
Given PUT this data: Given that I want to get a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
""" And I request "department"
{ Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that "dep_title" is set to "<dep_title>"
And that "dep_status" is set to "<dep_status>"
} Examples:
"""
And that I want to update "Assigned users" | dep_uid_number | dep_title | dep_status |
And I request "department/dep_uid/assign-user/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" | 1 | Department A UPDATE | INACTIVE |
Then the response status code should be 200 | 3 | Department B UPDATE | ACTIVE |
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object" Scenario Outline: Assign user to department created in this script
Given PUT this data:
"""
{
}
"""
And that I want to update "Assigned users"
And I request "department/dep_uid/assign-user/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
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"
Examples: Examples:
| Description | dep_uid_number | usr_uid | | Description | dep_uid_number | usr_uid |
| Assign user arlene in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 | | Assign user arlene in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 |
| Assign user andrew in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 | | Assign user andrew in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 |
| Assign user amy in department 2 created in this script | 2 | 25286582752d56713231082039265791 | | Assign user amy in department 2 created in this script | 2 | 25286582752d56713231082039265791 |
| Assign user sandra in department 2 created in this script | 2 | 25286582752d56713231082039265791 | | Assign user sandra in department 2 created in this script | 2 | 25286582752d56713231082039265791 |
| Assign user francis in department 5 created in this script | 5 | 62511352152d5673bba9cd4062743508 | | Assign user francis in department 5 created in this script | 5 | 62511352152d5673bba9cd4062743508 |
Scenario Outline: Set manager user to department Scenario Outline: Set manager user to department
Given PUT this data: Given PUT this data:
""" """
{ {
} }
""" """
And that I want to update "Department supervisor" And that I want to update "Department supervisor"
And I request "department/dep_uid/set-manager/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" And I request "department/dep_uid/set-manager/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_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 "object" And the type is "object"
Examples:
Examples: | Description | dep_uid_number | usr_uid |
| Set manager user "arlene" in group 1 | 1 | 23085901752d5671483a4c2059274810 |
| Description | dep_uid_number | usr_uid | | Set manager user "sandra" in group 2 | 2 | 25286582752d56713231082039265791 |
| Set manager user "arlene" in group 1 | 1 | 23085901752d5671483a4c2059274810 |
| Set manager user "sandra" in group 2 | 2 | 25286582752d56713231082039265791 |
Scenario Outline: Get a single department of created in this script Scenario Outline: Get a single department of created in this script
Given that I want to get a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" Given that I want to get a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
And I request "department" And I request "department"
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"
And that "dep_title" is set to "<dep_title>" And that "dep_title" is set to "<dep_title>"
And that "dep_status" is set to "<dep_status>" And that "dep_status" is set to "<dep_status>"
And that "dep_manager" is set to "<dep_manager>" And that "dep_manager" is set to "<dep_manager>"
And that "dep_manager_username" is set to "<dep_manager_username>" And that "dep_manager_username" is set to "<dep_manager_username>"
And that "dep_manager_firstname" is set to "<dep_manager_firstname>" And that "dep_manager_firstname" is set to "<dep_manager_firstname>"
And that "dep_manager_lastname" is set to "<dep_manager_lastname>" And that "dep_manager_lastname" is set to "<dep_manager_lastname>"
Examples: Examples:
| dep_uid_number | dep_title | dep_status | dep_manager | dep_manager_username | dep_manager_firstname | dep_manager_lastname | | dep_uid_number | dep_title | dep_status | dep_manager | dep_manager_username | dep_manager_firstname | dep_manager_lastname |
| 1 | Department A UPDATE | ACTIVE | 23085901752d5671483a4c2059274810 | arlene | Arlene | Cleveland | | 1 | Department A UPDATE | ACTIVE | 23085901752d5671483a4c2059274810 | arlene | Arlene | Cleveland |
| 2 | Department B | ACTIVE | 25286582752d56713231082039265791 | sandra | Sandra | Casey | | 2 | Department B | ACTIVE | 25286582752d56713231082039265791 | sandra | Sandra | Casey |
Scenario Outline: Unassign a User to department Scenario Outline: Unassign a User to department
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And that I want to update "Assigned users" And that I want to update "Assigned users"
And I request "department/dep_uid/unassign-user/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" And I request "department/dep_uid/unassign-user/<usr_uid>" with the key "dep_uid" stored in session array as variable "dep_uid_<dep_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 "object" And the type is "object"
Examples:
Examples: | Description | dep_uid_number | usr_uid |
| Unassign user arlene in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 |
| Description | dep_uid_number | usr_uid | | Unassign user andrew in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 |
| Unassign user arlene in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 | | Unassign user amy in department 2 created in this script | 2 | 25286582752d56713231082039265791 |
| Unassign user andrew in department 1 created in this script | 1 | 23085901752d5671483a4c2059274810 | | Unassign user sandra in department 2 created in this script | 2 | 25286582752d56713231082039265791 |
| Unassign user amy in department 2 created in this script | 2 | 25286582752d56713231082039265791 | | Unassign user francis in department 5 created in this script | 5 | 62511352152d5673bba9cd4062743508 |
| Unassign user sandra in department 2 created in this script | 2 | 25286582752d56713231082039265791 |
| Unassign user francis in department 5 created in this script | 5 | 62511352152d5673bba9cd4062743508 |
Scenario: List all Departaments in the workspace when exactly are 15 departaments created Scenario: List all Departaments in the workspace when exactly are 15 departaments created
Given I request "department" Given I request "department"
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 "array" And the type is "array"
And the response has 18 record And the response has 18 record
Scenario Outline: Delete a department created in this script Scenario Outline: Delete a department created in this script
Given that I want to delete a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>" Given that I want to delete a resource with the key "dep_uid" stored in session array as variable "dep_uid_<dep_uid_number>"
And I request "department" And I request "department"
Then the response status code should be 200 Then the response status code should be 200
And the content type is "application/json" And the content type is "application/json"
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:
| dep_uid_number | | dep_uid_number |
| 1 | | 1 |
| 2 | | 2 |
| 3 | | 3 |
| 4 | | 4 |
| 5 | | 5 |
Scenario: List all Departaments in the workspace when exactly are 16 departaments created Scenario: List all Departaments in the workspace when exactly are 16 departaments created
Given I request "department" Given I request "department"
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 "array" And the type is "array"
And the response has 15 record And the response has 15 record

View File

@@ -6,16 +6,16 @@ Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario Outline: Create a new departments in the workspace with bad parameters (negative tests) Scenario Outline: Create a new departments in the workspace with bad parameters (negative tests)
Given POST this data: Given POST this data:
""" """
{ {
"dep_title" : "<dep_title>", "dep_title" : "<dep_title>",
"dep_parent" : "<dep_parent>", "dep_parent" : "<dep_parent>",
"dep_status" : "<dep_status>" "dep_status" : "<dep_status>"
} }
""" """
And I request "department" And I request "department"
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>"
@@ -29,7 +29,7 @@ Scenario Outline: Create a new departments in the workspace with bad parameters
Scenario Outline: Assign user to department (NEGATIVE TEST) Scenario Outline: Assign user to department (NEGATIVE TEST)
Given PUT this data: Given PUT this data:
""" """
{ {
@@ -50,8 +50,7 @@ Scenario Outline: Create a new departments in the workspace with bad parameters
Scenario: Delete a department when have asigned user (negative tests) Scenario: Delete a department when have asigned user (negative tests)
Given that I want to delete a "Department" Given that I want to delete a "Department"
And I request "department/15978182252d5674d210310076985235" And I request "department/15978182252d5674d210310076985235"
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 "cannot be deleted"

View File

@@ -6,6 +6,15 @@ Feature: PM Group Main Tests
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: Get the Groups list when there are 20 records
And I request "groups?filter=&start=0&limit=50"
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 "array"
And the response has 20 records
Scenario Outline: Get list Groups of workspace using different filters Scenario Outline: Get list Groups of workspace using different filters
And I request "groups?filter=<filter>&start=<start>&limit=<limit>" And I request "groups?filter=<filter>&start=<start>&limit=<limit>"
And the content type is "application/json" And the content type is "application/json"
@@ -32,7 +41,7 @@ Feature: PM Group Main Tests
| Search letters 'de | de | 0 | 5 | 2 | 200 | | Search letters 'de | de | 0 | 5 | 2 | 200 |
Scenario Outline: Create 3 new Groups Scenario Outline: Create 3 new Groups
Given POST this data: Given POST this data:
""" """
{ {
@@ -55,6 +64,19 @@ Feature: PM Group Main Tests
| 1 | Demo Group2 for main behat | ACTIVE | | 1 | Demo Group2 for main behat | ACTIVE |
| 2 | Demo Group3 for main behat | INACTIVE | | 2 | Demo Group3 for main behat | INACTIVE |
Scenario: Create new group with same name
Given POST this data:
"""
{
"grp_title": "Accounting",
"grp_status": "ACTIVE"
}
"""
And I request "group"
Then the response status code should be 400
And the response status message should have the following text "already exists"
Scenario: Get the Groups list when there are 23 records Scenario: Get the Groups list when there are 23 records
And I request "groups?filter=&start=0&limit=50" And I request "groups?filter=&start=0&limit=50"
@@ -106,6 +128,37 @@ Feature: PM Group Main Tests
| 1 | Update Demo Group2 for main behat | INACTIVE | | 1 | Update Demo Group2 for main behat | INACTIVE |
| 2 | Update Demo Group3 for main behat | ACTIVE | | 2 | Update Demo Group3 for main behat | ACTIVE |
Scenario Outline: Update Group putting the same name of a group created in this script
Given PUT this data:
"""
{
"grp_title": "<grp_title>",
"grp_status": "<grp_status>"
}
"""
And that I want to update a resource with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
And I request "group"
Then the response status code should be 400
And the response status message should have the following text "exists"
Examples:
| grp_uid_number | grp_title | grp_status |
| 2 | Demo Group2 for main behat | INACTIVE |
#ASSIGN USER TO GROUP #ASSIGN USER TO GROUP

View File

@@ -53,4 +53,16 @@ Feature: PM Group Negative Tests
And I request "group/66623507552d56742865613066097298/user" And I request "group/66623507552d56742865613066097298/user"
And the content type is "application/json" And the content type is "application/json"
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 "usr_uid" And the response status message should have the following text "usr_uid"
Scenario: Assign the same user to the group
Given POST this data:
"""
{
"usr_uid": "00000000000000000000000000000001"
}
"""
And I request "group/70084316152d56749e0f393054862525/user"
Then the response status code should be 400
And the response status message should have the following text "already assigned"

View File

@@ -100,13 +100,13 @@ Feature: User Main Tests
Examples: Examples:
| Test_description | usr_number | usr_photo | | Test_description | usr_number | usr_photo |
| Create without replaced by, calendar | 1 | /home/wendy/photo/pic1.jpg | | Create without replaced by, calendar | 1 | /home/wendy/photo/pic1.jpg |
| Create without calendar | 2 | /home/wendy/photo/pic2.jpg | | Create without calendar | 2 | /home/wendy/photo/pic2.jpg |
| Create with all fields | 3 | /home/wendy/photo/pic3.jpg | | Create with all fields | 3 | /home/wendy/photo/pic3.jpg |
Scenario: Get the users List when there are exactly 63 users Scenario: Get the users List when there are exactly 68 users
And I request "users" And I request "users"
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
@@ -115,15 +115,39 @@ Feature: User Main Tests
And the response has 68 records And the response has 68 records
Scenario Outline: Create new User with same name
Given POST this data:
"""
{
"usr_firstname": "<usr_firstname>",
"usr_lastname": "<usr_lastname>",
"usr_username": "<usr_username>",
"usr_email": "<usr_email>",
"usr_address": "<usr_address>",
"usr_zip_code": "<usr_zip_code>",
"usr_country": "<usr_country>",
"usr_city": "<usr_city>",
"usr_location": "<usr_location>",
"usr_phone": "<usr_phone>",
"usr_position": "<usr_position>",
"usr_replaced_by": "<usr_replaced_by>",
"usr_due_date": "<usr_due_date>",
"usr_calendar": "<usr_calendar>",
"usr_status": "<usr_status>",
"usr_role": "<usr_role>",
"usr_new_pass": "<usr_new_pass>",
"usr_cnf_pass": "<usr_cnf_pass>"
}
"""
And I request "user"
Then the response status code should be 400
And the response status message should have the following text "already exists"
Examples:
Scenario: Get the users List when there are exactly 63 users | usr_firstname | usr_lastname | usr_username | usr_email | usr_address | usr_zip_code | usr_country | usr_city | usr_location | usr_phone | usr_position | usr_replaced_by | usr_due_date | usr_calendar | usr_status | usr_role | usr_new_pass | usr_cnf_pass |
And I request "users" | Amy | Connelly | amy | colosaqatest@gmail.com | | | | | | | | | 2015-01-14 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample |
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 "array"
And the response has 68 records
Scenario Outline: Update User and then check if the values had changed Scenario Outline: Update User and then check if the values had changed
Given PUT this data: Given PUT this data:
@@ -198,7 +222,42 @@ Feature: User Main Tests
| Update usr_status | 3 | sarita | sandler | sarita | saraah@gmail.com | laberh #985 | 555-9999 | AR | B | BUE | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin | | Update usr_status | 3 | sarita | sandler | sarita | saraah@gmail.com | laberh #985 | 555-9999 | AR | B | BUE | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin |
Scenario: Get the users List when there are exactly 63 users Scenario Outline: Update User with the same data from an existing user
Given PUT this data:
"""
{
"usr_firstname": "<usr_firstname>",
"usr_lastname": "<usr_lastname>",
"usr_username": "<usr_username>",
"usr_email": "<usr_email>",
"usr_address": "<usr_address>",
"usr_zip_code": "<usr_zip_code>",
"usr_country": "<usr_country>",
"usr_city": "<usr_city>",
"usr_location": "<usr_location>",
"usr_phone": "<usr_phone>",
"usr_position": "<usr_position>",
"usr_replaced_by": "<usr_replaced_by>",
"usr_due_date": "<usr_due_date>",
"usr_calendar": "<usr_calendar>",
"usr_status": "<usr_status>",
"usr_role": "<usr_role>",
"usr_new_pass": "<usr_new_pass>",
"usr_cnf_pass": "<usr_cnf_pass>"
}
"""
And that I want to update a resource with the key "usr_uid" stored in session array as variable "usr_uid_<usr_number>"
And I request "user"
Then the response status code should be 400
And the response status message should have the following text "already exists"
Examples:
| usr_number | usr_firstname | usr_lastname | usr_username | usr_email | usr_address | usr_zip_code | usr_country | usr_city | usr_location | usr_phone | usr_position | usr_replaced_by | usr_due_date | usr_calendar | usr_status | usr_role | usr_new_pass | usr_cnf_pass |
| 4 | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample |
Scenario: Get the users List when there are exactly 68 users
And I request "users" And I request "users"
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
@@ -206,6 +265,7 @@ Feature: User Main Tests
And the type is "array" And the type is "array"
And the response has 68 records And the response has 68 records
Scenario Outline: Delete all users created previously in this script Scenario Outline: Delete all users created previously in this script
Given that I want to delete a resource with the key "usr_uid" stored in session array as variable "usr_uid_<usr_number>" Given that I want to delete a resource with the key "usr_uid" stored in session array as variable "usr_uid_<usr_number>"
And I request "user" And I request "user"
@@ -230,5 +290,4 @@ Feature: User Main Tests
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 "array" And the type is "array"
And the response has 63 records And the response has 63 records

View File

@@ -105,6 +105,27 @@ Scenario: Get list of Roles
And the response has 11 records And the response has 11 records
Scenario Outline: Create new Role with same name
Given POST this data:
"""
{
"rol_code": "<rol_code>",
"rol_name": "<rol_name>",
"rol_status": "<rol_status>"
}
"""
And I request "role"
Then the response status code should be 400
And the response status message should have the following text "already exists"
Examples:
| rol_code | rol_name | rol_status |
| PROCESSMAKER_OPERATOR | Operator | ACTIVE |
#Assign users to role #Assign users to role
Scenario Outline: List assigned Users to Role & List available Users to assign to Role Scenario Outline: List assigned Users to Role & List available Users to assign to Role
@@ -216,6 +237,23 @@ Scenario Outline: Assign User to Role
| Assign user "olivia" | 8 | 73005191052d56727901138030694610 | | Assign user "olivia" | 8 | 73005191052d56727901138030694610 |
Scenario Outline: Assign same User to Role "1"
Given POST this data:
"""
{
"usr_uid": "<usr_uid>"
}
"""
And I request "role/rol_uid/user" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>"
Then the response status code should be 400
And the response status message should have the following text "already assigned"
Examples:
| Description | rol_uid_number | usr_uid |
| Assign user "aaron" | 1 | 51049032352d56710347233042615067 |
Scenario Outline: List assigned Users to Role & List available Users to assign to Role Scenario Outline: List assigned Users to Role & List available Users to assign to Role
Given I request "role/rol_uid/users" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>" Given I request "role/rol_uid/users" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
@@ -423,6 +461,23 @@ Scenario Outline: Assign Permission "PM_DASHBOARD" to Role
| Assign Permissions "PM_FOLDER_DEL" to rol 8 | 8 | 00000000000000000000000000000019 | | Assign Permissions "PM_FOLDER_DEL" to rol 8 | 8 | 00000000000000000000000000000019 |
Scenario Outline: Assign same Permission "PM_DASHBOARD" to Role 1
Given POST this data:
"""
{
"per_uid": "<per_uid>"
}
"""
And I request "role/rol_uid/permission" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>"
Then the response status code should be 400
And the response status message should have the following text "already assigned to the role"
Examples:
| Description | rol_uid_number | per_uid |
| Assign Permissions "PM_LOGIN" to rol 1 | 1 | 00000000000000000000000000000001 |
Scenario Outline: List assigned Permissions to Role & List available Permissions to assign to Role Scenario Outline: List assigned Permissions to Role & List available Permissions to assign to Role
Given I request "role/rol_uid/permissions" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>" Given I request "role/rol_uid/permissions" with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>"
Then the response status code should be 200 Then the response status code should be 200
@@ -583,6 +638,27 @@ Scenario Outline: Get a single Role created in this script
| Update name of role created in this script | 8 | PROCESSMAKER_OCHO | update*'123 | INACTIVE | | Update name of role created in this script | 8 | PROCESSMAKER_OCHO | update*'123 | INACTIVE |
Scenario Outline: Update Role with the same data from an existing role
Given PUT this data:
"""
{
"rol_code": "<rol_code>",
"rol_name": "<rol_name>",
"rol_status": "<rol_status>"
}
"""
And that I want to update a resource with the key "rol_uid" stored in session array as variable "rol_uid_<rol_uid_number>"
And I request "role"
Then the response status code should be 400
And the response status message should have the following text "already exists"
Examples:
| rol_uid_number | rol_code | rol_name | rol_status |
| 2 | PROCESSMAKER_TRES | Rol con code administrator | INACTIVE |
Scenario: Get list of Roles Scenario: Get list of Roles
Given I request "roles" Given I request "roles"
Then the response status code should be 200 Then the response status code should be 200

View File

@@ -160,7 +160,7 @@ class Server implements iAuthenticate
$request = \OAuth2\Request::createFromGlobals(); $request = \OAuth2\Request::createFromGlobals();
$response = $this->server->handleTokenRequest($request); $response = $this->server->handleTokenRequest($request);
/* DEPREACATED
$token = $response->getParameters(); $token = $response->getParameters();
if (array_key_exists('access_token', $token)) { if (array_key_exists('access_token', $token)) {
$data = $this->storage->getAccessToken($token['access_token']); $data = $this->storage->getAccessToken($token['access_token']);
@@ -168,7 +168,7 @@ class Server implements iAuthenticate
// verify if the client is our local PM Designer client // verify if the client is our local PM Designer client
if ($data['client_id'] == self::getPmClientId()) { if ($data['client_id'] == self::getPmClientId()) {
error_log('do stuff - is a request from local pm client'); error_log('do stuff - is a request from local pm client');
require_once "classes/model/PmoauthUserAccessTokens.php"; //require_once "classes/model/PmoauthUserAccessTokens.php";
$userToken = new \PmoauthUserAccessTokens(); $userToken = new \PmoauthUserAccessTokens();
$userToken->setAccessToken($token['access_token']); $userToken->setAccessToken($token['access_token']);
@@ -178,7 +178,7 @@ class Server implements iAuthenticate
$userToken->save(); $userToken->save();
} }
}*/ }
$response->send(); $response->send();
} }

View File

@@ -296,7 +296,7 @@ if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 ||
$config['safari_cookie_lifetime'] == 1)) { $config['safari_cookie_lifetime'] == 1)) {
ini_set('session.cookie_lifetime', $timelife); ini_set('session.cookie_lifetime', $timelife);
} }
//session_start(); session_start();
//$e_all = defined( 'E_DEPRECATED' ) ? E_ALL & ~ E_DEPRECATED : E_ALL; //$e_all = defined( 'E_DEPRECATED' ) ? E_ALL & ~ E_DEPRECATED : E_ALL;
//$e_all = defined( 'E_STRICT' ) ? $e_all & ~ E_STRICT : $e_all; //$e_all = defined( 'E_STRICT' ) ? $e_all & ~ E_STRICT : $e_all;
@@ -630,12 +630,6 @@ if (file_exists( $sSerializedFile )) {
//require_once ("propel/Propel.php"); //require_once ("propel/Propel.php");
//require_once ("creole/Creole.php"); //require_once ("creole/Creole.php");
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port";
$handler = new PmSessionHandler(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
session_start();
if (defined( 'DEBUG_SQL_LOG' ) && DEBUG_SQL_LOG) { if (defined( 'DEBUG_SQL_LOG' ) && DEBUG_SQL_LOG) {
define( 'PM_PID', mt_rand( 1, 999999 ) ); define( 'PM_PID', mt_rand( 1, 999999 ) );
require_once 'Log.php'; require_once 'Log.php';