diff --git a/features/backend/activity/main_tests_activity.feature b/features/backend/activity/main_tests_activity.feature index d09001f0f..9e31ff58e 100644 --- a/features/backend/activity/main_tests_activity.feature +++ b/features/backend/activity/main_tests_activity.feature @@ -10,6 +10,7 @@ Feature: Activity Resources Main Tests Given that I have a valid access_token + Scenario Outline: Get the Properties and Definition of 3 Activities Given I request "project//activity/" Then the response status code should be 200 @@ -19,6 +20,7 @@ Feature: Activity Resources Main Tests And the "properties" property type is "object" And that "tas_title" is set to "" + Examples: | project | activity | tas_title | diff --git a/features/backend/assignee/main_tests_assignee.feature b/features/backend/assignee/main_tests_assignee.feature index 2ffdea31d..ff07db5aa 100644 --- a/features/backend/assignee/main_tests_assignee.feature +++ b/features/backend/assignee/main_tests_assignee.feature @@ -35,8 +35,8 @@ Scenario Outline: Get the list of available users and groups to be assigned to a | test_description | project | activity | filter | start | limit | records | aas_uid | aas_type| | 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 | + | Using filter="financial" should return 1 available group | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | financial | 0 | 1 | 1 | 99025456252d567468f0798036479112 | group | + | Using filter="finance" should return 1 available group | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | finance | 0 | 1 | 1 | 66623507552d56742865613066097298 | group | Scenario Outline: Assign 2 users and 2 group to an activity @@ -70,9 +70,9 @@ Scenario Outline: Get the list of available users and groups to be assigned to a And the "aas_type" property in row 0 equals "" Examples: - | test_description | project | activity | records | aas_uid | aas_type | + | test_description | project | activity | records | aas_uid | aas_type | | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 65496814252977243d57684076211485 | 7 | 54731929352d56741de9d42002704749 | group | - | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 5 | 36775342552d5674146d9c2078497230 | group | + | Verify that the activity has expected quantity of asignees | 4224292655297723eb98691001100052 | 68911670852a22d93c22c06005808422 | 5 | 36775342552d5674146d9c2078497230 | group | Scenario Outline: List assignees of an activity using a filter diff --git a/features/backend/assignee/negative_tests_assignee.feature b/features/backend/assignee/negative_tests_assignee.feature index 07ae06702..41d449000 100644 --- a/features/backend/assignee/negative_tests_assignee.feature +++ b/features/backend/assignee/negative_tests_assignee.feature @@ -65,7 +65,7 @@ Scenario Outline: Assign a user or group to an activity (Field validation) | search 0 | 0 | 0 | 100 | 0 | 200 | array | | negative numbers | a | -10 | -20 | 0 | 400 | string| | real numbers | a | 0.0 | 1.0 | 1 | 200 | string| - | real numbers | a | 0.0 | 0.0 | 3 | 200 | string| + | real numbers | a | 0.0 | 0.0 | 0 | 200 | string| | real numbers | a | 0.1 | 1.4599 | 0 | 400 | string| | real numbers | a | 1.5 | 1.4599 | 0 | 400 | string| diff --git a/features/backend/case_scheduler/basic_sequence_case_scheduler.feature b/features/backend/case_scheduler/basic_sequence_case_scheduler.feature new file mode 100644 index 000000000..e3a48c3a4 --- /dev/null +++ b/features/backend/case_scheduler/basic_sequence_case_scheduler.feature @@ -0,0 +1,83 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Case Scheduler Resources + + Background: + Given that I have a valid access_token + + Scenario: Create a new case scheduler for a project + Given POST this data: + """ + { + "sch_option": "3", + "sch_name": "Test scheduler #1", + "sch_del_user_name": "admin", + "sch_del_user_pass": "admin", + "tas_uid": "46941969352af5be2ab3f39001216717", + "sch_start_time": "18:00", + "sch_start_date": "2014-01-20", + "sch_end_date": "2014-01-20", + "sch_every_days": "", + "sch_week_days": "", + "sch_start_day": "1", + "sch_start_day_opt_1": "2", + "sch_start_day_opt_2": "", + "sch_months": "1|6|12", + "sch_repeat_every": "", + "sch_repeat_until": "" + } + """ + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "sch_uid" in session array as variable "sch_uid" + + Scenario: Get a List of case scheduler of a project + Given I request "project/1265557095225ff5c688f46031700471/case-schedulers" + 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 record + + Scenario: Get a single case scheduler of a project + Given that I want to get a resource with the key "sch_uid" stored in session array + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 200 + And the content type is "application/json" + And the type is "object" + + Scenario: Update a case scheduler for a project + Given PUT this data: + """ + { + "sch_name": "Test scheduler #1 modify", + "sch_del_user_name": "admin", + "sch_del_user_pass": "admin", + "tas_uid": "46941969352af5be2ab3f39001216717", + "sch_start_time": "20:00", + "sch_start_date": "2014-02-01", + "sch_end_date": "2014-02-01", + "sch_every_days": "", + "sch_week_days": "", + "sch_start_day": "1", + "sch_start_day_opt_1": "2", + "sch_start_day_opt_2": "", + "sch_months": "1|6|12", + "sch_repeat_every": "", + "sch_repeat_until": "" + } + """ + And that I want to update a resource with the key "sch_uid" stored in session array + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + 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" + + Scenario: Delete a case scheduler of a project + Given that I want to delete a resource with the key "sch_uid" stored in session array + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 200 + And the response charset is "UTF-8" \ No newline at end of file diff --git a/features/backend/case_scheduler/main_tests_case_scheduler.feature b/features/backend/case_scheduler/main_tests_case_scheduler.feature new file mode 100644 index 000000000..57281ca85 --- /dev/null +++ b/features/backend/case_scheduler/main_tests_case_scheduler.feature @@ -0,0 +1,162 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Case Scheduler Main Tests + Requirements: + a workspace with the process 1265557095225ff5c688f46031700471 ("Test Michelangelo") already loaded + there are zero case scheduler in the process and there four tasks in the process + + Background: + Given that I have a valid access_token + + Scenario: Get the case schedulers list when there are exactly zero case schedulers + Given I request "project/1265557095225ff5c688f46031700471/case-schedulers" + 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 record + + + Scenario Outline: Create a 13 case scheduler for a project + Given POST this data: + """ + { + "sch_del_user_name": "", + "sch_del_user_pass": "", + "tas_uid": "", + "sch_name": "", + "sch_option": "", + "sch_start_date": "", + "sch_end_date": "", + "sch_start_time": "", + "sch_week_days": "", + "sch_start_day": "", + "sch_start_day_opt_1": "", + "sch_months": "", + "sch_start_day_opt_2": "", + "sch_repeat_every": "" + } + """ + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "sch_uid" in session array as variable "sch_uid_" + + + Examples: + + | test_description | sch_uid_number | sch_del_user_name | sch_del_user_pass | tas_uid | sch_name | sch_option | sch_start_date | sch_end_date | sch_start_time | sch_week_days | sch_start_day | sch_start_day_opt_1 | sch_months | sch_start_day_opt_2 | sch_repeat_every | + | Create with Daily | 1 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Daily 123@#$ | 1 | 2014-01-30 | 2014-02-20 | 12:00 | | | | | | | + | Create with Weekly, sch_week_days=monday | 2 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly monday 345%$# | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 1 | | | | | | + | Create with Weekly, sch_week_days=tuesday, wednesday, thursday, friday, saturday, sunday | 3 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly 345%$# | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 2\|3\|4\|5\|6\|7 | | | | | | + | Create with Monthly and day of month, day of month=1, of the month(s)=3,4 | 4 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 1 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 15 | 3\|4 | | | + | Create with Monthly and day of month, day of month=1, of the month=1,2,5,6,7,8,9,10,11,12 | 5 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 2 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 15 | 1\|2\|5\|6\|7\|8\|9\|10\|11\|12 | | | + | Create with Monthly and the day=first and Monday | 6 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 3 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 1\|7 | | + | Create with Monthly and the day=second and Saturday | 7 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 4 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 2\|6 | | + | Create with Monthly and the day=Third and Friday | 8 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 5 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 3\|5 | | + | Create with Monthly and the day=second and Thursday | 9 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 6 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 2\|4 | | + | Create with Monthly and the day=last and Wednesday | 10 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 7 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 5\|3 | | + | Create with Monthly and the day=last and Wednesday, of the month=1,2,6,7,8,9,10,11,12 | 11 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 8 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 1\|2\|6\|7\|8\|9\|10\|11\|12 | 5\|3 | | + | Create with One time only | 12 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-One Time only 678%$@ | 4 | | | 20:00 | | | | | | | + | Craate with Every | 13 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Every 987&%@ | 5 | | | | | | | | | 12.30 | + + + Scenario: Get the case schedulers list when there are exactly 13 case schedulers + Given I request "project/1265557095225ff5c688f46031700471/case-schedulers" + 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 13 record + + + Scenario Outline: Update the case schedulers for a project and then check if the values had changed + Given PUT this data: + """ + { + "sch_del_user_name": "", + "sch_del_user_pass": "", + "tas_uid": "", + "sch_name": "", + "sch_option": "", + "sch_start_date": "", + "sch_end_date": "", + "sch_start_time": "", + "sch_week_days": "", + "sch_start_day": "", + "sch_start_day_opt_1": "", + "sch_months": "", + "sch_start_day_opt_2": "", + "sch_repeat_every": "" + } + """ + And that I want to update a resource with the key "sch_uid" stored in session array as variable "sch_uid_" + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + 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 | sch_uid_number | sch_del_user_name | sch_del_user_pass | tas_uid | sch_name | sch_option | sch_start_date | sch_end_date | sch_start_time | sch_week_days | sch_start_day | sch_start_day_opt_1 | sch_months | sch_start_day_opt_2 | sch_repeat_every | + | Update Daily | 1 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Daily 123@#$ | 1 | 2014-02-30 | 2014-03-20 | 12:30 | | | | | | | + | Update Weekly, sch_week_days=monday | 2 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Weekly monday 345%$# | 2 | 2014-03-20 | 2014-04-20 | 08:30 | 2 | | | | | | + | Update Monthly and day of month, day of month=1, of the month(s)=3,4 | 4 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Monthly 567&^% 1 | 3 | 2014-04-21 | 2014-05-18 | 18:30 | | 1 | 18 | 3\|4\|5 | | | + | Update One time only | 12 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-One Time only 678%$@ | 4 | | | 20:30 | | | | | | | + | Update Every | 13 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Every 987&%@ | 5 | | | | | | | | | 18.30 | + + + Scenario Outline: Get a single case scheduler of a project and check some properties + Given that I want to get a resource with the key "sch_uid" stored in session array as variable "sch_uid_" + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 200 + And the content type is "application/json" + And the type is "object" + And the response charset is "UTF-8" + And that "tas_uid" is set to "" + And that "sch_name" is set to "" + And that "sch_start_date" is set to "" + And that "sch_end_date" is set to "" + And that "sch_start_time" is set to "" + And that "sch_week_days" is set to "" + And that "sch_start_day" is set to "" + And that "sch_start_day_opt_1" is set to "" + And that "sch_months" is set to "" + And that "sch_repeat_every" is set to "" + + Examples: + + | sch_uid_number | sch_del_user_name | sch_del_user_pass | tas_uid | sch_name | sch_option | sch_start_date | sch_end_date | sch_start_time | sch_week_days | sch_start_day | sch_start_day_opt_1 | sch_months | sch_start_day_opt_2 | sch_repeat_every | + | 1 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Daily 123@#$ | 1 | 2014-02-30 | 2014-03-20 | 12:30 | | | | | | | + | 2 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Weekly monday 345%$# | 2 | 2014-03-20 | 2014-04-20 | 08:30 | 2 | | | | | | + | 4 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Monthly 567&^% 1 | 3 | 2014-04-21 | 2014-05-18 | 18:30 | | 2 | 18 | 3\|4\|5 | | | + | 12 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-One Time only 678%$@ | 4 | | | 20:30 | | | | | | | + | 13 | admin | admin | 1352844695225ff5fe54de2005407079 | Update Case Scheduler-Every 987&%@ | 5 | | | | | | | | | 18:30 | + + + + Scenario Outline: Delete all case scheduler of a project created previously in this script + Given that I want to delete a resource with the key "sch_uid" stored in session array as variable "sch_uid_" + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + + Examples: + + | sch_uid_number | + | 1 | + | 2 | + | 3 | + | 4 | + | 5 | + | 6 | + | 7 | + | 8 | + | 9 | + | 10 | + | 11 | + | 12 | + | 13 | \ No newline at end of file diff --git a/features/backend/case_scheduler/negative_tests_case_scheduler.feature b/features/backend/case_scheduler/negative_tests_case_scheduler.feature new file mode 100644 index 000000000..ab8fcdc7f --- /dev/null +++ b/features/backend/case_scheduler/negative_tests_case_scheduler.feature @@ -0,0 +1,60 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Output Documents Negative Tests + + + Background: + Given that I have a valid access_token + + Scenario Outline: Create a new case scheduler for a project with bad parameters (negative tests) + Given POST this data: + """ + { + "sch_del_user_name": "", + "sch_del_user_pass": "", + "tas_uid": "", + "sch_name": "", + "sch_option": "", + "sch_start_date": "", + "sch_end_date": "", + "sch_start_time": "", + "sch_week_days": "", + "sch_start_day": "", + "sch_start_day_opt_1": "", + "sch_months": "", + "sch_start_day_opt_2": "", + "sch_repeat_every": "" + } + """ + And I request "project/1265557095225ff5c688f46031700471/case-scheduler" + Then the response status code should be + And the response status message should have the following text "" + + + Examples: + + | test_description | sch_del_user_name | sch_del_user_pass | tas_uid | sch_name | sch_option | sch_start_date | sch_end_date | sch_start_time | sch_week_days | sch_start_day | sch_start_day_opt_1 | sch_months | sch_start_day_opt_2 | sch_repeat_every | error_code | error_message | + | Invalid sch_option | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Daily 123@#$ | 20 | 2014-01-30 | 2014-02-20 | 12:00 | | | | | | | 400 | sch_option | + | Invalid sch_del_user_name | sample | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly monday 345%$# | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 1 | | | | | | 400 | User | + | Invalid sch_del_user_pass | admin | sample | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly 345%$# | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 2\|3\|5\|6\|7 | | | | | | 400 | password | + | Invalid tas_uid | admin | admin | 00000000000005be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 1 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 15 | 3\|4 | | | 400 | task | + | Invalid sch_start_time | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 2 | 3 | 2014-03-21 | 2014-04-18 | 39:00:99 | | 1 | 15 | 1\|2\|5\|6\|7\|8\|9\|10\|11\|12 | | | 400 | sch_start_time | + | Invalid sch_start_date | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 3 | 3 | 2014-20-35 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 1\|7 | | 400 | sch_start_date | + | Invalid sch_week_days | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 4 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | 8\|9\|10 | 2 | | 3\|4\|5 | 2\|6 | | 400 | sch_week_days | + | Invalid sch_start_date | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 5 | 3 | 2014-33-76 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 3\|5 | | 400 | sch_start_date | + | Invalid sch_start_day_opt_1 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 6 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 87 | 3\|4\|5 | 2\|4 | | 400 | sch_start_day_opt_1 | + | Invalid sch_start_day_opt_2 | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 7 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 3\|4\|5 | 9\|10 | | 400 | sch_start_day_opt_2 | + | Invalid sch_months | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 8 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 2 | | 13\|54\|65 | 5\|3 | | 400 | sch_months | + | Invalid sch_end_date | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-One Time only 678%$@ 9 | 3 | 2014-03-21 | 2015-54-87 | 20:00 | | 1 | | 3\|4 | | | 400 | sch_end_date | + | Invalid sch_repeat_every | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Every 987&%@ 10 | 5 | | | | | | | | | 43:30 | 400 | sch_repeat_every | + | Field requered sch_option | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Daily 123@#$ 11 | | 2014-01-30 | 2014-02-20 | 12:00 | | | | | | | 400 | sch_option | + | Field requered sch_name | admin | admin | 46941969352af5be2ab3f39001216717 | | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 1 | | | | | | 400 | sch_name | + | Field requered sch_del_user_name | | sample | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly 345%$# 12 | 2 | 2014-02-20 | 2014-03-20 | 08:00 | 2\|3\|4\|5\|6\|7 | | | | | | 400 | User | + | Field requered sch_del_user_pass | admin | | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 113 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 15 | 3\|4 | | | 400 | password | + | Field requered tas_uid | admin | admin | | Case Scheduler-Monthly 567&^% 14 | 3 | 2014-03-21 | 2014-04-18 | 39:00:99 | | 1 | 15 | 1\|2\|5\|6\|7\|8\|9\|10\|11\|12 | | | 400 | tas_uid | + | Field requered sch_start_time | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 15 | 3 | 2014-20-35 | 2014-04-18 | | | 2 | | 3\|4\|5 | 1\|7 | | 400 | sch_start_time | + | Field requered sch_start_date | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 16 | 3 | | 2014-04-18 | 18:00 | 8\|9\|10 | 2 | | 3\|4\|5 | 2\|6 | | 400 | sch_start_date | + | Field requered sch_week_days | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Weekly monday 345%$# 17 | 2 | 2014-02-20 | 2014-03-20 | 08:00 | | | | | | | 400 | sch_week_days | + | Field requered sch_start_day | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 18 | 3 | 2014-33-76 | 2014-04-18 | 18:00 | | | | 3\|4\|5 | 3\|5 | | 400 | sch_start_day | + | Field requered sch_months | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 19 | 3 | 2014-03-21 | 2014-04-18 | 18:00 | | 1 | 16 | | 2\|4 | | 400 | sch_months | + | Field requered sch_end_date | admin | admin | 46941969352af5be2ab3f39001216717 | Case Scheduler-Monthly 567&^% 20 | 3 | 2014-03-21 | | 18:00 | | 2 | | 3\|4\|5 | 9\|10 | | 400 | sch_end_date | + \ No newline at end of file diff --git a/features/backend/step/main_tests_step.feature b/features/backend/step/main_tests_step.feature index 4b2bfbd5f..57e5228bf 100644 --- a/features/backend/step/main_tests_step.feature +++ b/features/backend/step/main_tests_step.feature @@ -9,14 +9,19 @@ Feature: Project Properties - Step Resources Main Tests Given that I have a valid access_token - Scenario: List assigned Steps to "Task1" - Given I request "project/16062437052cd6141881e06088349078/activity/10163687452cd6234e0dd25086954968/steps" + Scenario Outline: List assigned Steps to "Task1" & "Task2" (empty) + Given I request "project//activity//steps" 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 json data is an empty array + And the response has records + Examples: + + | test_description | project | activity | records | + | 0 steps in Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 0 | + | 1 steps in Task 2 | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 1 | Scenario Outline: Assign a 5 Steps to an Activity @@ -43,8 +48,7 @@ Feature: Project Properties - Step Resources Main Tests | Dynaform assigned to Task 1 in mode edit | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 1 | EDIT | 1 | | Input Document assigned to Task 1 in mode edit | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | INPUT_DOCUMENT | 83199959452cd62589576c1018679557 | | 2 | EDIT | 2 | | Output Document assigned to Task 1 in mode edit | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | OUTPUT_DOCUMENT | 32743823452cd63105006e1076595203 | | 3 | EDIT | 3 | - | Dynaform assigned to Task 2 in mode edit with condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 63293140052cd61b29e21a9056770986 | @@YEAR==2013 | 1 | EDIT | 4 | - | Dynaform assigned to Task 2 in mode view | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 2 | VIEW | 5 | + | Dynaform assigned to Task 2 in mode view | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 2 | VIEW | 4 | @@ -69,11 +73,10 @@ Feature: Project Properties - Step Resources Main Tests Examples: | test_description | project | activity | step_condition | step_position | step_mode | step_type_obj | step_uid_obj | step_number | - | Update Dynaform Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | @@YEAR==2013 | 2 | VIEW | DYNAFORM | 50332332752cd9b9a7cc989003652905 | 1 | - | Update Input Document Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | @@YEAR==2014 | 3 | VIEW | INPUT_DOCUMENT | 83199959452cd62589576c1018679557 | 2 | - | Update Output Document Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | | 1 | VIEW | OUTPUT_DOCUMENT | 32743823452cd63105006e1076595203 | 3 | - | Update Dynaform Task 2 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | @@YEAR==2014 | 2 | VIEW | DYNAFORM | 63293140052cd61b29e21a9056770986 | 4 | - | Update Dynaform Task 2 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | @@YEAR==2014 | 1 | EDIT | DYNAFORM | 50332332752cd9b9a7cc989003652905 | 5 | + | Update Dynaform Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | @@YEAR==2013 | 4 | VIEW | DYNAFORM | 50332332752cd9b9a7cc989003652905 | 1 | + | Update Input Document Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | @@YEAR==2014 | 5 | VIEW | INPUT_DOCUMENT | 83199959452cd62589576c1018679557 | 2 | + | Update Output Document Task 1 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | | 6 | VIEW | OUTPUT_DOCUMENT | 32743823452cd63105006e1076595203 | 3 | + | Update Dynaform Task 2 (step_condition, step_position, step_mode) | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | @@YEAR==2014 | 2 | EDIT | DYNAFORM | 50332332752cd9b9a7cc989003652905 | 4 | Scenario Outline: List assigned Steps to "Task1" & "Task 2" @@ -95,59 +98,42 @@ Feature: Project Properties - Step Resources Main Tests | 2 steps in task 2 - verify that the first record is the first position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 2 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | - - Scenario Outline: Unassign all steps assigned previously in this script in task 1 - Given that I want to delete a resource with the key "step_uid" stored in session array as variable "step_uid_" - And I request "project//activity//step" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - - Examples: - - | project | activity | step_uid_obj | step_number | - | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 50332332752cd9b9a7cc989003652905 | 1 | - | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 83199959452cd62589576c1018679557 | 2 | - | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 32743823452cd63105006e1076595203 | 3 | - - - - - Scenario: List assigned Steps to "Task1" - Given I request "project/16062437052cd6141881e06088349078/activity/10163687452cd6234e0dd25086954968/steps" - 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 json data is an empty array - - #STEP TRIGGERS Scenario Outline: List assigned Triggers to "Task2" - Given I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/63293140052cd61b29e21a9056770986/triggers" + Given I request "project//activity//step/step_uid/triggers" with the key "step_uid" stored in session array as variable "step_uid_" 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 json data is an empty array - Examples: + Examples: - | test_description | project | activity | step_type_obj | step_uid_obj | step_condition | step_position | step_mode | step_number | - | Dynaform assigned to Task 2 in mode edit with condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 63293140052cd61b29e21a9056770986 | @@YEAR==2013 | 1 | EDIT | 4 | - | Dynaform assigned to Task 2 in mode view | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 2 | VIEW | 5 | + | test_description | project | activity | step_number | + | List a triggers in dynaform of task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | + | List a triggers in Input Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | + | List a triggers in Output Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | + | List a triggers in Dynaform of task 2 | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | - Scenario: List available Triggers to "Task2" when there are exactly three triggers - Given I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/65093024352cd9df93d9675058012924/available-triggers/before" + Scenario Outline: List available Triggers for each assigned step + Given I request "project//activity//step/step_uid/available-triggers/before" with the key "step_uid" stored in session array as variable "step_uid_" 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 3 records + Examples: + + | test_description | project | activity | step_number | + | List available a triggers in dynaform of task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | + | List available a triggers in Input Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | + | List available a triggers in Output Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | + | List available a triggers in Dynaform of task 2 | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | + + Scenario Outline: Assign a 3 triggers to a Step Given POST this data: @@ -159,29 +145,58 @@ Feature: Project Properties - Step Resources Main Tests "st_position": "" } """ - And I request "project//activity//step//trigger" + And I request "project//activity//step/step_uid/trigger" with the key "step_uid" stored in session array as variable "step_uid_" 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 "step_uid" in session array as variable "tri_uid_" + Examples: - | test_description | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | BEFORE | | 1 | - | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | AFTER | | 1 | - | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | AFTER | | 2 | + | test_description | project | activity | step_number | tri_uid_number | tri_uid | st_type | st_condition | st_position | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 1 | 81919273152cd636c665080083928728 | BEFORE | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 2 | 56359776552cd6378b38e47080912028 | BEFORE | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 3 | 57401970252cd6393531551040242546 | BEFORE | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 4 | 81919273152cd636c665080083928728 | AFTER | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 5 | 56359776552cd6378b38e47080912028 | AFTER | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 6 | 57401970252cd6393531551040242546 | AFTER | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 7 | 81919273152cd636c665080083928728 | BEFORE | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 8 | 56359776552cd6378b38e47080912028 | BEFORE | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 9 | 57401970252cd6393531551040242546 | BEFORE | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 10 | 81919273152cd636c665080083928728 | AFTER | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 11 | 56359776552cd6378b38e47080912028 | AFTER | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 12 | 57401970252cd6393531551040242546 | AFTER | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 13 | 81919273152cd636c665080083928728 | BEFORE | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 14 | 56359776552cd6378b38e47080912028 | BEFORE | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 15 | 57401970252cd6393531551040242546 | BEFORE | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 16 | 81919273152cd636c665080083928728 | AFTER | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 17 | 56359776552cd6378b38e47080912028 | AFTER | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 18 | 57401970252cd6393531551040242546 | AFTER | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 19 | 81919273152cd636c665080083928728 | BEFORE | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 20 | 56359776552cd6378b38e47080912028 | BEFORE | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 21 | 57401970252cd6393531551040242546 | BEFORE | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 22 | 81919273152cd636c665080083928728 | AFTER | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 23 | 56359776552cd6378b38e47080912028 | AFTER | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 24 | 57401970252cd6393531551040242546 | AFTER | | 3 | - Scenario: List available Triggers to "Task2" when there are exactly zero triggers - Given I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/65093024352cd9df93d9675058012924/available-triggers/before" + Scenario Outline: List available Triggers for each assigned step + Given I request "project//activity//step/step_uid/available-triggers/before" with the key "step_uid" stored in session array as variable "step_uid_" 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 0 records + Examples: + + | test_description | project | activity | step_number | + | List available a triggers in dynaform of task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | + | List available a triggers in Input Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | + | List available a triggers in Output Document of Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | + | List available a triggers in Dynaform of task 2 | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | + Scenario Outline: Update a Trigger assignation of a Step if the values had changed @@ -194,8 +209,7 @@ Feature: Project Properties - Step Resources Main Tests "st_position": "" } """ - And that I want to update a resource with the key "step_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger" + And I request "project//activity//step/step_uid/trigger/" with the key "step_uid" stored in session array as variable "step_uid_" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" @@ -203,16 +217,15 @@ Feature: Project Properties - Step Resources Main Tests Examples: - | test_description | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Update st_type, st_condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | AFTER | @@var1 == 1 | 1 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | BEFORE | @@var1 == 2 | 2 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | BEFORE | @@var1 == 1 | 1 | + | test_description | project | activity | step |tri_uid_number | step_number | tri_uid | st_type | st_condition | st_position | + | Update st_type, st_condition | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 65093024352cd9df93d9675058012924 | 1 | 1 | 81919273152cd636c665080083928728 | BEFORE | @@var1 == 1 | 1 | + | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 65093024352cd9df93d9675058012924 | 2 | 1 | 56359776552cd6378b38e47080912028 | BEFORE | @@var1 == 2 | 2 | + | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 65093024352cd9df93d9675058012924 | 3 | 1 | 57401970252cd6393531551040242546 | BEFORE | @@var1 == 1 | 3 | Scenario Outline: Get a single Triggers and check some properties - Given that I want to get a resource with the key "tri_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger" + Given I request "project//activity//step/step_uid/trigger//" with the key "step_uid" stored in session array as variable "step_uid_" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" @@ -224,154 +237,104 @@ Feature: Project Properties - Step Resources Main Tests Examples: - | test_description | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Update st_type, st_condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | AFTER | @@var1 == 1 | 1 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | BEFORE | @@var1 == 2 | 2 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | BEFORE | @@var1 == 1 | 1 | + | test_description | project | activity | step_number | tri_uid_number | tri_uid | st_type | st_condition | st_position | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 1 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 2 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 3 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 4 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 5 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 6 | 57401970252cd6393531551040242546 | after | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 7 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 8 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 9 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 10 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 11 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 12 | 57401970252cd6393531551040242546 | after | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 13 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 14 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 15 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 16 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 17 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 18 | 57401970252cd6393531551040242546 | after | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 19 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 20 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 21 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 22 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 23 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 24 | 57401970252cd6393531551040242546 | after | | 3 | + - Scenario Outline: Delete all Triggers assignation of a Step + Scenario Outline: Delete all Triggers created in task 1 for step "Output document demo" and task 2 for step "Dynaform Demo 1" Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger/" + And I request "project//activity//step/step_uid/trigger//" with the key "step_uid" stored in session array as variable "step_uid_" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" - Examples: + Examples: - | project | activity | step |tri_uid_number | tri_uid | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | + | test_description | project | activity | step_number | tri_uid_number | tri_uid | st_type | st_condition | st_position | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 13 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 14 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 15 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 16 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 17 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 18 | 57401970252cd6393531551040242546 | after | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 19 | 81919273152cd636c665080083928728 | before | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 20 | 56359776552cd6378b38e47080912028 | before | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 21 | 57401970252cd6393531551040242546 | before | | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 22 | 81919273152cd636c665080083928728 | after | | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 23 | 56359776552cd6378b38e47080912028 | after | | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 24 | 57401970252cd6393531551040242546 | after | | 3 | - #GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/step/{step_uid}/triggers - # List assigned Triggers to a Step - Scenario: List Triggers assigned to first Step of "Task2" + + Scenario Outline: List assigned Triggers to each step. The las two shoul report 0 records + Given I request "project//activity//step/step_uid/triggers" with the key "step_uid" stored in session array as variable "step_uid_" + 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 records + + Examples: + + | test_description | project | activity | step_number | records | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | 6 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | 6 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | 0 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | 0 | + + + Scenario Outline: Unassign all"DynaForm Demo1" from "Task1" Given that I have a valid access_token - And I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/65093024352cd9df93d9675058012924/triggers" + And that I want to delete a resource with the key "step1" stored in session array + Given that I want to delete a resource with the key "step_uid" stored in session array as variable "step_uid_" + And I request "project//activity//step" 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 json data is an empty array - - - - #TRIGGERS OF STEP "ASSIGN TASK" - - Scenario: List Triggers assigned to Step "Assign Task" of "Task2", when are exactly three triggers - Given I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/triggers" - 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 json data is an empty array - - - Scenario Outline: Assign a three triggers to a Step "Assign Task" - Given POST this data: - """ - { - "tri_uid": "", - "st_type": "", - "st_condition": "", - "st_position": "" - } - """ - And I request "project//activity//step//trigger" - 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 "step_uid" in session array as variable "tri_uid_" Examples: - | test_description | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | BEFORE_ASSIGNMENT | | 1 | - | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | BEFORE_ROUTING | | 1 | - | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | AFTER_ROUTING | | 2 | + | test_description | project | activity | step_number | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 1 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 2 | + | Trigger assigned to Task 2 in type After | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 3 | + | Trigger assigned to Task 2 in type before | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 4 | - - - Scenario: List available Triggers to "Task2" when there are exactly zero triggers - Given I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/65093024352cd9df93d9675058012924/available-triggers" + + Scenario Outline: List assigned Steps to "Task1" & "Task2" (empty) (verify if everithing was deleted) + Given I request "project//activity//steps" 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 0 records + And the response has records + Examples: - Scenario Outline: Update a Trigger assignation of a Step if the values had changed - Given PUT this data: - """ - { - "tri_uid": "", - "st_type": "", - "st_condition": "", - "st_position": "" - } - """ - And that I want to update a resource with the key "step_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger" - 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 | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Update st_type, st_condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | AFTER_ROUTING | @@var1 == 1 | 1 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | BEFORE_ASSIGNMENT | @@var1 == 2 | 2 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | BEFORE_ROUTING | @@var1 == 1 | 1 | - - - Scenario Outline: Get a single Triggers and check some properties - Given that I want to get a resource with the key "tri_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger" - 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 that "tri_uid" is set to "" - And that "st_type" is set to "" - And that "st_condition" is set to "" - And that "st_position" is set to "" - - - Examples: - - | test_description | project | activity | step |tri_uid_number | tri_uid | st_type | st_condition | st_position | - | Update st_type, st_condition | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | AFTER_ROUTING | @@var1 == 1 | 1 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | BEFORE_ASSIGNMENT | @@var1 == 2 | 2 | - | Update st_type, st_condition and st_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | BEFORE_ROUTING | @@var1 == 1 | 1 | - - - Scenario Outline: Delete all Triggers assignation of a Step - Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid_" - And I request "project//activity//step//trigger/" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - Examples: - - | project | activity | step |tri_uid_number | tri_uid | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 1 | 81919273152cd636c665080083928728 | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 2 | 56359776552cd6378b38e47080912028 | - | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 65093024352cd9df93d9675058012924 | 3 | 57401970252cd6393531551040242546 | - - - #GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/step/{step_uid}/triggers - # List assigned Triggers to a Step - Scenario: List Triggers assigned to first Step of "Task2" - Given that I have a valid access_token - And I request "project/16062437052cd6141881e06088349078/activity/89706843252cd9decdcf9b3047762708/step/65093024352cd9df93d9675058012924/triggers" - 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 json data is an empty array + | test_description | project | activity | records | + | 0 steps in Task 1 | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | 0 | + | 1 steps in Task 2 | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | 1 | \ No newline at end of file diff --git a/features/backend/step/negative_tests_step.feature b/features/backend/step/negative_tests_step.feature index 4fd031dec..d4689861a 100644 --- a/features/backend/step/negative_tests_step.feature +++ b/features/backend/step/negative_tests_step.feature @@ -28,6 +28,6 @@ Feature: Steps Resources Negative Tests | Invalid step_type_obj - Ôutput Document | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | OUTT_DMEN123@#$ | 32743823452cd63105006e1076595203 | | 3 | EDIT | 400 | step_type_obj | | Invalid step_position | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 63293140052cd61b29e21a9056770986 | @@YEAR==2013 | 2,34/76 | EDIT | 400 | step_position | | Invalid step_mode | 16062437052cd6141881e06088349078 | 89706843252cd9decdcf9b3047762708 | DYNAFORM | 63293140052cd61b29e21a9056770986 | | 5 | sample12 | 400 | step_mode | - | Field requered project | | 10163687452cd6234e0dd25086954968 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 1 | EDIT | 400 | project | - | Field requered activity | 16062437052cd6141881e06088349078 | | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 1 | EDIT | 400 | activity | + | Field requered project | | 10163687452cd6234e0dd25086954968 | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 1 | EDIT | 400 | prj_uid | + | Field requered activity | 16062437052cd6141881e06088349078 | | DYNAFORM | 50332332752cd9b9a7cc989003652905 | | 1 | EDIT | 400 | act_uid | | Field requered step_uid_obj | 16062437052cd6141881e06088349078 | 10163687452cd6234e0dd25086954968 | DYNAFORM | | | 1 | EDIT | 400 | step_uid_obj | \ No newline at end of file diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 72280d612..5d5cd542f 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -356,7 +356,7 @@ class RestContext extends BehatContext $url .= $this->_restGetQueryStringSuffix; } $this->_request = $this->_client - ->get($url, $this->_headers); + ->get($url, $this->_headers); $this->_response = $this->_request->send(); break; case 'POST': @@ -1211,6 +1211,35 @@ class RestContext extends BehatContext + } + + /** + * @Given /^I request "([^"]*)" with the key "([^"]*)" stored in session array as variable "([^"]*)"$/ + */ + public function iRequestWithTheKeyStoredInSessionArrayAsVariable($pageUrl, $varName, $sessionVarName) + { + if (file_exists("session.data")) { + $sessionData = json_decode(file_get_contents("session.data")); + } else { + $sessionData = array(); + } + if (!isset($sessionData->$sessionVarName) ) { + $varValue = ''; + } else { + $varValue = $sessionData->$sessionVarName; + } + + + $pageUrl = str_replace($varName, $varValue, $pageUrl); + + + $this->printDebug("URL: $pageUrl\n$varName = $varValue\n"); + + + $this->iRequest($pageUrl); + + + }