diff --git a/behat.yml.dist b/behat.yml.dist index c22acdb95..a8869196e 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -3,4 +3,4 @@ default: context: parameters: base_url: http://192.168.11.181/api/1.0/michelangelo/ - access_token: ff4bdec9e8e2e3b2fa3fb03bc3a7d287fd0dcf26 + access_token: cd5cff9b2e3ebabf49e276e47e977fab5988c00e diff --git a/features/processmaker/event.feature b/features/processmaker/event.feature new file mode 100644 index 000000000..235806870 --- /dev/null +++ b/features/processmaker/event.feature @@ -0,0 +1,61 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Testing triggers + + @1: TEST FOR POST EVENT /---------------------------------------------------------------------- + Scenario: Create a event + Given that I have a valid access_token + And POST this data: + """ + { + "evn_description": "DE BEHAT", + "evn_status": "ACTIVE", + "evn_action": "SEND_MESSAGE", + "evn_related_to": "SINGLE", + "tas_uid": "97192372152a5c78f04a794095806311", + "evn_tas_uid_from": "97192372152a5c78f04a794095806311", + "evn_tas_estimated_duration": 1, + "evn_time_unit": "DAYS", + "evn_when": 1, + "evn_when_occurs": "AFTER_TIME", + "tri_uid": "95325847552af0c07792c15098680510" + } + """ + And I request "project/251815090529619a99a2bf4013294414/event" + Then the response status code should be 201 + And store "evn_uid" in session array + + @2: TEST FOR PUT EVENT /----------------------------------------------------------------------- + Scenario: Update a event + Given that I have a valid access_token + And PUT this data: + """ + { + "evn_description": "change description", + "evn_status": "ACTIVE", + "evn_action": "SEND_MESSAGE", + "evn_related_to": "SINGLE", + "tas_uid": "97192372152a5c78f04a794095806311", + "evn_tas_uid_from": "97192372152a5c78f04a794095806311", + "evn_tas_estimated_duration": 1, + "evn_time_unit": "DAYS", + "evn_when": 1, + "evn_when_occurs": "AFTER_TIME", + "tri_uid": "95325847552af0c07792c15098680510" + } + """ + And that I want to update a resource with the key "evn_uid" stored in session array + And I request "project/251815090529619a99a2bf4013294414/event" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + + @3: TEST FOR GET EVENT /----------------------------------------------------------------------- + Scenario: Get a event + Given that I have a valid access_token + And that I want to get a resource with the key "evn_uid" stored in session array + And I request "project/251815090529619a99a2bf4013294414/event" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "evn_description" is set to "change description" \ No newline at end of file diff --git a/features/processmaker/trigger.feature b/features/processmaker/trigger.feature new file mode 100644 index 000000000..edfd62a31 --- /dev/null +++ b/features/processmaker/trigger.feature @@ -0,0 +1,23 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Testing triggers + Scenario: List triggers of an project + Given that I have a valid access_token + And I request "project/534152995521df6bb5986c4062665559/triggers" + 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" + + + + Scenario: Create a trigger + Given that I have a valid access_token + And POST this data: + """ + { + "tri_title": "nuevo triggerr", + "tri_description": "descripcion" + } + """ + And I request "project/534152995521df6bb5986c4062665559/trigger" + Then the response status code should be 201 \ No newline at end of file