Files
luos/features/backend/projects/triggers/main_tests_triggers.feature

155 lines
8.8 KiB
Gherkin
Raw Normal View History

2014-01-27 10:15:06 -04:00
@ProcessMakerMichelangelo @RestAPI
Feature: Testing triggers Main Tests
Requirements:
a workspace with the process 251815090529619a99a2bf4013294414 already loaded
the process name is "Test (Triggers, Activity)"
there are two triggers in the process
Background:
Given that I have a valid access_token
Scenario: Get the Triggers List when there are exactly two triggers
Given I request "project/251815090529619a99a2bf4013294414/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"
And the response has 2 records
And the "tri_title" property in row 0 equals "For event: change description"
And the "tri_title" property in row 1 equals "para eventos"
Scenario: Get a single trigger of a project
the trigger is previously created
Given I request "project/251815090529619a99a2bf4013294414/trigger/65317729852cf0ce339bfa4020392914"
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 "tri_title" property equals "For event: change description"
And the "tri_description" property equals "Autogenerated For event: change description"
Scenario Outline: Create 5 new triggers
Given POST this data:
"""
{
"tri_title": "<tri_title>",
"tri_description": "<tri_description>",
"tri_type": "<tri_type>",
"tri_webbot": "<tri_webbot>",
"tri_param": "<tri_param>"
}
"""
And I request "project/<project>/trigger"
Then the response status code should be 201
And store "tri_uid" in session array as variable "tri_uid_<tri_number>"
Examples:
| test_description | project | tri_number | tri_title | tri_description |tri_type | tri_webbot | tri_param |
| Create trigger with title alphabetic and with webbot | 251815090529619a99a2bf4013294414 | 1 | nuevo trigger 1 | descripcion del primer trigger 1 |SCRIPT | @@user1 = @@USER_LOGGED; \n $x = rand(); | PRIVATE |
| Create trigger with title alphanumeric and with webbot | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | descripcion del segundo trigger 2 |SCRIPT | //Trigger with comments | PRIVATE |
| Create trigger without webbot | 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 |SCRIPT | | PRIVATE |
| Create trigger without tri type | 251815090529619a99a2bf4013294414 | 4 | otro trigger 4 | descripcion del tercer trigger 4 | | | PRIVATE |
| Create trigger without tri param | 251815090529619a99a2bf4013294414 | 5 | otro trigger 5 | descripcion del tercer trigger 5 | | | |
Scenario: Create a new triggers with same name
Given POST this data:
"""
{
"tri_title": "nuevo trigger 1",
"tri_description": "descripcion del primer trigger 1",
"tri_type": "SCRIPT",
"tri_webbot": "@@user1 = @@USER_LOGGED; \n $x = rand();",
"tri_param": "PRIVATE"
}
"""
And I request "project/251815090529619a99a2bf4013294414/trigger"
Then the response status code should be 400
And the response status message should have the following text "same name"
2014-01-27 10:15:06 -04:00
Scenario: Get the Triggers List when there are 7 records
Given I request "project/251815090529619a99a2bf4013294414/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"
And the response has 7 records
Scenario Outline: Update the Triggers and then check if the values had changed
Given PUT this data:
"""
{
"tri_title": "<tri_title>",
"tri_description": "<tri_description>",
"tri_type": "<tri_type>",
"tri_webbot": "<tri_webbot>",
"tri_param": "<tri_param>"
}
"""
And that I want to update a resource with the key "tri_uid" stored in session array as variable "tri_uid_<tri_number>"
And I request "project/<project>/trigger"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Examples:
| test_description | project | tri_number | tri_title | tri_description |tri_type | tri_webbot | tri_param |
| Update title | 251815090529619a99a2bf4013294414 | 1 | Update nuevo trigger 1 @#$%^&*½²³€¼½ | descripcion del primer trigger 1 |SCRIPT | @@user1 = @@USER_LOGGED; \n $x = rand(); | PRIVATE |
| Update Description | 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | Update descripcion del segundo trigger 2 @#$%^&*½²³€¼½ |SCRIPT | //Trigger with comments | PRIVATE |
| Update webbot | 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 |SCRIPT | //Trigger with comments update | PRIVATE |
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_<tri_number>"
And I request "project/<project>/trigger"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "tri_title" is set to "<tri_title>"
And that "tri_description" is set to "<tri_description>"
And that "tri_webbot" is set to "<tri_webbot>"
Examples:
| project | tri_number | tri_title | tri_description | tri_webbot |
| 251815090529619a99a2bf4013294414 | 1 | Update nuevo trigger 1 @#$%^&*½²³€¼½ | descripcion del primer trigger 1 | @@user1 = @@USER_LOGGED; \n $x = rand(); |
| 251815090529619a99a2bf4013294414 | 2 | otro trigger 2 | Update descripcion del segundo trigger 2 @#$%^&*½²³€¼½ | //Trigger with comments |
| 251815090529619a99a2bf4013294414 | 3 | otro trigger 3 | descripcion del tercer trigger 3 | //Trigger with comments update |
Scenario Outline: Delete all Triggers created previously in this script
Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid_<tri_number>"
And I request "project/<project>/trigger"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Examples:
| project | tri_number |
| 251815090529619a99a2bf4013294414 | 1 |
| 251815090529619a99a2bf4013294414 | 2 |
| 251815090529619a99a2bf4013294414 | 3 |
| 251815090529619a99a2bf4013294414 | 4 |
| 251815090529619a99a2bf4013294414 | 5 |
Scenario: Get the Triggers List when there are exactly two triggers
Given I request "project/251815090529619a99a2bf4013294414/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"
And the response has 2 records
And the "tri_title" property in row 0 equals "For event: change description"
And the "tri_title" property in row 1 equals "para eventos"