Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Output Documents Main Tests
|
||||
Requirements:
|
||||
a workspace with the process 4224292655297723eb98691001100052 already loaded
|
||||
the process name is "Test Users-Step-Properties End Point"
|
||||
a workspace with the process 4224292655297723eb98691001100052 ("Test Users-Step-Properties End Point") already loaded
|
||||
there are two output documents in the process
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Project Properties - Assignee Resources
|
||||
Feature: Assignee Resources
|
||||
Requirements:
|
||||
a workspace with the process 4224292655297723eb98691001100052 ("Test Users-Step-Properties End Point") already loaded
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Get a list of available users and groups to be assigned to an activity
|
||||
Scenario Outline: Get the list of available users and groups to be assigned to an activity
|
||||
Check that there are exactly 82 available users for task "Task 1"
|
||||
Given I request "project/<project>/activity/<activity>/available-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
@@ -18,7 +21,7 @@ Feature: Project Properties - Assignee Resources
|
||||
| test_description | project | activity | records | aas_uid | aas_type |
|
||||
| check if the list of possible users and groups to be assigned is correct | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 82 | 54731929352d56741de9d42002704749 | group |
|
||||
|
||||
Scenario Outline: Get a list of available users and groups to be assigned to an activity using filter
|
||||
Scenario Outline: Get the list of available users and groups to be assigned to an activity using filter
|
||||
Given I request "project/<project>/activity/<activity>/available-assignee?filter=<filter>&start=<start>&limit=<limit>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
@@ -30,8 +33,11 @@ Scenario Outline: Get a list of available users and groups to be assigned to an
|
||||
|
||||
Examples:
|
||||
| test_description | project | activity | filter | start | limit | records | aas_uid | aas_type|
|
||||
| Using filter get available users that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 50 | 2 | 66623507552d56742865613066097298 | group |
|
||||
| Using filter get 1 available user that match with "fin" | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 1 | 1 | 66623507552d56742865613066097298 | group |
|
||||
| Using filter="fin" with no limits should return 2 groups | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 50 | 2 | 66623507552d56742865613066097298 | group |
|
||||
| Using filter="fin", start="1", limit="1" should return 1 group | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | fin | 0 | 1 | 1 | 66623507552d56742865613066097298 | group |
|
||||
| Using filter="financial" should return 1 available group | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | financial | 0 | 1 | 1 | 62528621852cda436afe755036997717 | group |
|
||||
| Using filter="finance" should return 1 available group | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | finance | 0 | 1 | 1 | 17707415052cda432dd4774063621869 | group |
|
||||
|
||||
|
||||
Scenario Outline: Assign 2 users and 2 group to an activity
|
||||
Given POST this data:
|
||||
@@ -53,8 +59,6 @@ Scenario Outline: Get a list of available users and groups to be assigned to an
|
||||
| assign a group to the second task | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 | group |
|
||||
|
||||
|
||||
|
||||
|
||||
Scenario Outline: After assignation - List assignees of each activity
|
||||
Given I request "project/<project>/activity/<activity>/assignee"
|
||||
Then the response status code should be 200
|
||||
@@ -86,6 +90,7 @@ Scenario Outline: List assignees of an activity using a filter
|
||||
| Filtered list should return 1 record | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 1 | 73005191052d56727901138030694610 | user | oli |
|
||||
| Filtered list should return 1 record | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 1 | 36775342552d5674146d9c2078497230 | group | emp |
|
||||
|
||||
|
||||
Scenario Outline: Get a single user or group of an activity
|
||||
Given I request "project/<project>/activity/<activity>/assignee/<aas_uid>"
|
||||
Then the response status code should be 200
|
||||
@@ -100,7 +105,8 @@ Scenario Outline: List assignees of an activity using a filter
|
||||
|
||||
Examples:
|
||||
| test_description | project | activity | aas_uid | aas_type | aas_name | aas_lastname | aas_username |
|
||||
| Obtain details of user assigend to an activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | Olivia | Austin | olivia |
|
||||
| Obtain details of user assigned to an activity | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 73005191052d56727901138030694610 | user | Olivia | Austin | olivia |
|
||||
|
||||
|
||||
Scenario Outline: Remove assignee from an activity
|
||||
Given that I want to delete a resource with the key "aas_uid" stored in session array
|
||||
@@ -115,7 +121,6 @@ Scenario Outline: List assignees of an activity using a filter
|
||||
| Remove a user from activity | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 36775342552d5674146d9c2078497230 |
|
||||
|
||||
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 200
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@ProcessMakerMichelangelo @RestAPI @assignee @negative
|
||||
Feature: Project Properties -Assignee Resources - Negative tests
|
||||
Requirements:
|
||||
a workspace with the process 4224292655297723eb98691001100052 ("Test Users-Step-Properties End Point") already loaded
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
@@ -37,3 +39,34 @@ Scenario Outline: Assign a user or group to an activity (Field validation)
|
||||
| Asignando un usuario como grupo | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | group |
|
||||
| Asignando un usuario con type inexistente | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 69191356252cda41acde328048794164 | department |
|
||||
|
||||
|
||||
Scenario Outline: List assignees of an activity using different filters
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee?filter=<filter>&start=<start>&limit=<limit>"
|
||||
Then the response status code should be <http_code>
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "<type>"
|
||||
And the response has <records> records
|
||||
|
||||
Examples:
|
||||
| test_description | filter | start | limit | records | http_code | type |
|
||||
| lowercase | admin | 0 | 1 | 1 | 200 | array |
|
||||
| uppercase | ADMIN | 0 | 1 | 1 | 200 | array |
|
||||
| limit=3 | a | 0 | 3 | 3 | 200 | array |
|
||||
| limit and start | a | 1 | 2 | 2 | 200 | array |
|
||||
| high number for start | a | 1000 | 1 | 0 | 200 | array |
|
||||
| high number for start | a | 1000 | 0 | 0 | 200 | array |
|
||||
| empty result | xyz | 0 | 0 | 0 | 200 | array |
|
||||
| empty string | | 0 | 10000 | 0 | 200 | array |
|
||||
| empty string | | 1 | 2 | 0 | 200 | array |
|
||||
| invalid start | a | b | c | 0 | 400 | string|
|
||||
| invalid limit | a | 0 | c | 0 | 400 | string|
|
||||
| search 0 | 0 | 0 | 0 | 0 | 200 | array |
|
||||
| search 0 | 0 | 0 | 100 | 0 | 200 | array |
|
||||
| negative numbers | a | -10 | -20 | 0 | 200 | array |
|
||||
| real numbers | a | 0.0 | 1.0 | 0 | 400 | string|
|
||||
| real numbers | a | 0.0 | 0.0 | 0 | 400 | string|
|
||||
| real numbers | a | 0.1 | 1.4599 | 0 | 400 | string|
|
||||
| real numbers | a | 1.5 | 1.4599 | 0 | 400 | string|
|
||||
|
||||
|
||||
|
||||
@@ -1111,8 +1111,13 @@ class RestContext extends BehatContext
|
||||
{
|
||||
$data = $this->_data;
|
||||
if (!is_array($data)) {
|
||||
if ($quantityOfRecords == 0) {
|
||||
//if we expect 0 records and the response in fact is not an array, just return as a valid test
|
||||
return;
|
||||
} else {
|
||||
throw new Exception("the Response data is not an array!\n\n" );
|
||||
}
|
||||
}
|
||||
$currentRecordsCount=count($data);
|
||||
if($currentRecordsCount!=$quantityOfRecords){
|
||||
throw new Exception('Records quantity not match ' . $quantityOfRecords . ' (actual: ' . $currentRecordsCount . ")\n\n");
|
||||
|
||||
Reference in New Issue
Block a user