From 9274d319f94df1d85a5d4098793cbc4ac08f5175 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Fri, 14 Feb 2014 12:35:37 -0400 Subject: [PATCH] Behat Completo para el Feature Pm User --- .../pm_user/main_tests_pm_user.feature | 212 +++++++++++++++++- .../pm_user/negative_tests_pm_user.feature | 77 ++++++- 2 files changed, 287 insertions(+), 2 deletions(-) diff --git a/features/backend/pm_user/main_tests_pm_user.feature b/features/backend/pm_user/main_tests_pm_user.feature index 67339a3bb..db2a5c4a7 100644 --- a/features/backend/pm_user/main_tests_pm_user.feature +++ b/features/backend/pm_user/main_tests_pm_user.feature @@ -1 +1,211 @@ -ygyfgy \ No newline at end of file +@ProcessMakerMichelangelo @RestAPI +Feature: User Main Tests + Requirements: + a workspace with the 63 users created already loaded + there are one users Active Directory in the process + + Background: + Given that I have a valid access_token + + Scenario Outline: Get list Users of workspace using different filters + And I request "users?filter=&start=&limit=" + And the content type is "application/json" + Then the response status code should be + And the response charset is "UTF-8" + And the type is "array" + And the response has records + + Examples: + + | test_description | filter | start | limit | records | http_code | + | lowercase | admin | 0 | 9 | 1 | 200 | + | uppercase | ADMIN | 0 | 9 | 1 | 200 | + | limit=3 | a | 0 | 3 | 3 | 200 | + | limit and start | a | 1 | 2 | 2 | 200 | + | high number for start | a | 1000 | 1 | 0 | 200 | + | high number for start | a | 1000 | 0 | 0 | 200 | + | empty result | xyz | 0 | 0 | 0 | 200 | + | empty string | | 0 | 10000 | 63 | 200 | + | empty string | | 1 | 2 | 2 | 200 | + | search 0 | 0 | 0 | 0 | 0 | 200 | + | search 0 | 0 | 0 | 100 | 0 | 200 | + | Search letters 'c' | c | 0 | 5 | 5 | 200 | + | Search letters 'de | de | 0 | 5 | 2 | 200 | + | Search not created | for | 0 | 25 | 0 | 200 | + + + Scenario: Get the users List when there are exactly 63 users + And I request "users" + 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 63 records + + + Scenario: Get list Users + And I request "user/00000000000000000000000000000001" + 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 the "usr_username" property equals "admin" + And the "usr_firstname" property equals "Administrator" + + + Scenario Outline: Create new User + Given POST this data: + """ + { + "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 "user" + And the content type is "application/json" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the type is "object" + And store "usr_uid" in session array as variable "usr_uid_" + + + Examples: + + | Test_description | 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 | + | Create without replaced by, calendar | 1 | jhon | smith | jhon | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | + | Create without calendar | 2 | will | carter | will | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample | + | Create with all fields | 3 | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | admin | admin | + | Create user Inactive | 4 | daniela | perez | daniela | daniela@gmail.com | grenn #544 | 555-6565 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | INACTIVE | PROCESSMAKER_OPERATOR | sample | sample | + | Create user Vacation | 5 | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample | + + + Scenario: Get the users List when there are exactly 63 users + And I request "users" + 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 + Given PUT this data: + """ + { + "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 that I want to update a resource with the key "usr_uid" stored in session array as variable "usr_uid_" + And I request "user" + 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: + + | Test_description | 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 | + | Update usr_calendar, usr_role | 1 | jhon | smith | jhon | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | sample | sample | + | Update usr_firstname, usr_lastname, usr_username | 2 | william | carters | william | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample | + | Update usr_status | 3 | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin | + + + Scenario Outline: Get a single Users and check some properties + And I request "user" + 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 that "usr_firstname" is set to "" + And that "usr_lastname" is set to "" + And that "usr_username" is set to "" + And that "usr_email" is set to "" + And that "usr_address" is set to "" + And that "usr_zip_code" is set to "" + And that "usr_country" is set to "" + And that "usr_city" is set to "" + And that "usr_location" is set to "" + And that "usr_phone" is set to "" + And that "usr_position" is set to "" + And that "usr_replaced_by" is set to "" + And that "usr_due_date" is set to "" + And that "usr_calendar" is set to "" + And that "usr_status" is set to "" + And that "usr_role" is set to "" + And that "usr_new_pass" is set to "" + And that "usr_cnf_pass" is set to "" + + 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 | + | 1 | jhon | smith | jhon | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | sample | sample | + | 2 | william | carters | william | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample | + | 3 | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | INACTIVE | PROCESSMAKER_ADMIN | admin | admin | + + + Scenario: Get the users List when there are exactly 63 users + And I request "users" + 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: 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_" + And I request "user" + 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: + + | usr_number | + | 1 | + | 2 | + | 3 | + | 4 | + | 5 | + + + Scenario: Get the users List when there are exactly 63 users + And I request "users" + 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 63 records \ No newline at end of file diff --git a/features/backend/pm_user/negative_tests_pm_user.feature b/features/backend/pm_user/negative_tests_pm_user.feature index 692f0135d..8ea92d835 100644 --- a/features/backend/pm_user/negative_tests_pm_user.feature +++ b/features/backend/pm_user/negative_tests_pm_user.feature @@ -1 +1,76 @@ -jhjh \ No newline at end of file +@ProcessMakerMichelangelo @RestAPI +Feature: PM User Main Tests + Requirements: + a workspace with the 63 users created already loaded + there are one users Active Directory in the process + + Background: + Given that I have a valid access_token + + Scenario Outline: Get list Users of workspace using different filters with bad parameters (negative tests) + And I request "users?filter=&start=&limit=" + And the content type is "application/json" + Then the response status code should be + + Examples: + + | test_description | filter | start | limit | records | error_code | + | Invalid start | a | b | c | 0 | 400 | + | Invalid limit | a | 0 | c | 0 | 400 | + | real numbers | a | 0.1 | 1.4599 | 0 | 400 | + | real numbers | a | 1.5 | 1.4599 | 0 | 400 | + | real numbers | a | 0.0 | 1.0 | 1 | 400 | + | real numbers | a | 0.0 | 0.0 | 0 | 400 | + + + Scenario Outline: Create new User with bad parameters (negative tests) + Given POST this data: + """ + { + "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 "user" + Then the response status code should be + And the type is "" + And the response status message should have the following text "" + + + Examples: + + | Test_description | 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 | error_code | type | error_message | + | Invalid usr_email | jhon | smith | jhon | jhonsmith | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | usr_email | + | Invalid usr_country | will | carter | will | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample | 400 | string | | + | Invalid usr_city | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | admin | admin | 400 | string | | + | Invalid usr_location | daniela | perez | daniela | daniela@gmail.com | grenn #544 | 555-6565 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | INACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | | + | Invalid usr_replaced_by | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | United States | Florida | Miami | 555-6655-555 | Gerencia | 61364466400000000000333333333333 | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | | + | Invalid usr_due_date | jhon | smith | jhon | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | sample | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | usr_due_date | + | Invalid usr_status | will | carter | will | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | INPUT | PROCESSMAKER_MANAGER | sample | sample | 400 | string | | + | Invalid usr_role | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | 2014-12-12 | 99159704252f501c63f8c58025859967 | ACTIVE | INPUT_DOCUMENT | admin | admin | 400 | string | | + | Invalid without usr_firstname | | perez | daniel | daniela@gmail.com | grenn #544 | 555-6565 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | INACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | required | + | Invalid without usr_lastname | micaela | | brayan | micaela@gmail.com | sancjh #544 | 555-6652 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | required | + | Invalid without usr_username | jhon | smith | | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | required | + | Invalid without usr_email | will | carter | herbert | | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | sample | sample | 400 | string | required | + | Invalid without usr_due_date | saraah | sandler | saraah | saraah@gmail.com | laberh #985 | 555-9999 | AR | BA | BA | 2353643644 | Desarrollo | 61364466452d56711adb378002702791 | | 99159704252f501c63f8c58025859967 | ACTIVE | PROCESSMAKER_ADMIN | admin | admin | 400 | string | required | + | Invalid without usr_status | daniela | perez | daniella | daniela@gmail.com | grenn #544 | 555-6565 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | required | + | Invalid usr_role | micaela | sanchez | micaeella | micaela@gmail.com | sancjh #544 | 555-6652 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | | sample | sample | 400 | string | required | + | Invalid wrong password | jhon | smith | jhon | jhon@gmail.com | grenn #344 | 555-6555 | United States | Florida | Miami | 555-6655-555 | Gerencia | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | igual | 400 | string | same | + | short length of the password | will | carter | will | will@gmail.com | saim #45 | 555-6522 | Bo | LP | LP | 23344444 | Adminsitracion | 44811996752d567110634a1013636964 | 2014-12-12 | | ACTIVE | PROCESSMAKER_MANAGER | hol | hol | 400 | string | Minimum length | + | Create with User exist | Peter | Vanko | peter | colosaqatest@gmail.com | | | | | | | | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | exists |