Merged in wnestor/processmaker (pull request #582)

Adicion de nuevos file para el feature variables
This commit is contained in:
Erik Amaru Ortiz
2014-07-07 09:16:35 -04:00
14 changed files with 541 additions and 213 deletions

View File

@@ -35,7 +35,7 @@ Feature: User
#GET /api/1.0/{workspace}/user/{usr_uid}
# Upload a image
Scenario: Upload a image
Given POST I want to upload the image "/home/wendy/photo/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
Given POST I want to upload the image "/photo/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
#POST /api/1.0/{workspace}/user
# Create new User

View File

@@ -101,9 +101,9 @@ Feature: User Main Tests
Examples:
| Test_description | usr_number | usr_photo |
| Create without replaced by, calendar | 1 | /home/wendy/photo/pic1.jpg |
| Create without calendar | 2 | /home/wendy/photo/pic2.jpg |
| Create with all fields | 3 | /home/wendy/photo/pic3.jpg |
| Create without replaced by, calendar | 1 | /photo/pic1.jpg |
| Create without calendar | 2 | /photo/pic2.jpg |
| Create with all fields | 3 | /photo/pic3.jpg |
Scenario: Get the users List when there are exactly 68 users

View File

@@ -606,4 +606,70 @@ Scenario: case tasks of case 145, case on unassigned list
And that "del_task_due_date" is set to "2014-04-02 15:02:17"
And that "del_finish_date" is set to "Not finished"
And that "duration" is set to "Not finished"
And that "color" is set to "#FF0000"
And that "color" is set to "#FF0000"
# BUG 15290, Derivation Of Screen Error in execution
Scenario Outline: Create a new case with process attach in the bug reporter
Given POST this data:
"""
{
"pro_uid": "<pro_uid>",
"tas_uid": "<tas_uid>",
"variables": [{"name": "admin", "amount":"1030"}]
}
"""
And I request "cases"
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 store "app_uid" in session array as variable "app_uid_<case_number>"
And store "app_number" in session array as variable "app_number_<case_number>"
Examples:
| Description | case_number | pro_uid | tas_uid |
| Create new case with process "testExecutionOfDerivationScreen" | 1 | 87648819953a85c0abc01d3080475981 | 75617018953a885be331271018981055 |
Scenario Outline: Route a case to the next task in the process
Given PUT this data:
"""
{
"del_index": "1"
}
"""
And I request "cases/app_uid/route-case" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
Examples:
| test_description | case_number |
| Derivate case of the process | 1 |
Scenario Outline: Delete a case
Given PUT this data:
"""
{
}
"""
And that I want to delete a resource with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
And I request "cases"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
Examples:
| test_description | case_number |
| Delete a case 1 | 1 |

View File

@@ -23,7 +23,7 @@ Scenario: Returns an uploaded documents for a given case
Scenario: Post metadata and then upload documents for a given case
Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/170220159534214f642abb8058832933/input-document"
Given POST upload an input document "/uploadfiles/test1.html" to "cases/170220159534214f642abb8058832933/input-document"
"""
{

View File

@@ -33,11 +33,11 @@ Scenario Outline: Post metadata and then upload documents for a given case
And store "app_doc_uid" in session array as variable "app_doc_uid_<app_doc_uid_number>"
Examples:
| app_doc_uid_number | document_file | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
| 1 | /home/wendy/uploadfiles/test1.html | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 2 | /home/wendy/uploadfiles/random.jpg | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 3 | /home/wendy/uploadfiles/test.pm | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 4 | /home/wendy/uploadfiles/test.txt | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| app_doc_uid_number | document_file | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
| 1 | /uploadfiles/test1.html | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 2 | /uploadfiles/random.jpg | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 3 | /uploadfiles/test.pm | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
| 4 | /uploadfiles/test.txt | 170220159534214f642abb8058832933 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
Scenario Outline: Returns an uploaded documents for a given case
Given I request "cases/<case_uid>/input-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"

View File

@@ -189,83 +189,84 @@ Scenario Outline: Delete all case scheduler of a project created previously in t
#Scenario para la revision del "BUG 15040" donde se comprueba la creacion de nuevos case scheduler en diferentes proyectos BPMN.
#Scenario Outline: Create a new case scheduler with same name
# Given POST this data:
# """
# {
# "sch_option": "5",
# "sch_name": "sample",
# "sch_del_user_name": "admin",
# "tas_uid": "4790702485368efad167477011123879",
# "sch_start_time": "",
# "sch_start_date": "",
# "sch_end_date": "",
# "sch_week_days": "",
# "sch_start_day": "",
# "sch_start_day_opt_1": "",
# "sch_start_day_opt_2": "",
# "sch_months": "",
# "sch_repeat_every": "12.30"
# }
# """
# And I request "project/1455892245368ebeb11c1a5001393784/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_<sch_uid_number>"
#
# Examples:
#
# | test_description | sch_uid_number |
# | Create with Daily | 1 |
#
#
#Scenario Outline: Create new Projects with event case scheduler
# Given POST data from file "<project_template>"
# And I request "projects"
# 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 "array"
# And store "new_uid" in session array as variable "project_new_uid_<project_new_uid_number>" where an object has "object" equal to "project"
# And store "new_uid" in session array as variable "diagram_new_uid_<project_new_uid_number>" where an object has "object" equal to "diagram"
# And store "new_uid" in session array as variable "activity_new_uid_<project_new_uid_number>" where an object has "object" equal to "activity"
# And store "new_uid" in session array as variable "evn_uid_<evn_uid_number>" where an object has "object" equal to "event"
# And store "new_uid" in session array as variable "flow_new_uid_<project_new_uid_number>" where an object has "object" equal to "flow"
#
# Examples:
#
# | Description | project_new_uid_number | evn_uid_number | project_template |
# | Create a new project with event case scheduler | 1 | 3 | project_bug_case_scheduler1.json |
# | Create a new project with event case scheduler | 2 | 4 | project_bug_case_scheduler2.json |
#
#
#Scenario Outline: Delete all Events created previously in this script
# Given that I want to delete a resource with the key "evn_uid" stored in session array as variable "evn_uid_<evn_uid_number>"
# And I request "project/<project_new_uid_number>/event"
# Then the response status code should be 200
# And the response charset is "UTF-8"
# And the type is "object"
#
# Examples:
#
# | project_new_uid_number | evn_uid_number |
# | 1 | 3 |
# | 2 | 4 |
#
#
#Scenario Outline: Delete a Project previously created in this script
# Given that I want to delete a resource with the key "new_uid" stored in session array as variable "project_new_uid_<project_new_uid_number>" in position 0
# And I request "projects"
# 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:
#
# | project_new_uid_number |
# | 1 |
# | 2 |
Scenario Outline: Create a new case scheduler with same name
Given POST this data:
"""
{
"sch_option": "5",
"sch_name": "sample",
"sch_del_user_name": "admin",
"tas_uid": "4790702485368efad167477011123879",
"sch_start_time": "",
"sch_start_date": "",
"sch_end_date": "",
"sch_week_days": "",
"sch_start_day": "",
"sch_start_day_opt_1": "",
"sch_start_day_opt_2": "",
"sch_months": "",
"sch_repeat_every": "12.30"
}
"""
And I request "project/<project>/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_<sch_uid_number>"
Examples:
| test_description | sch_uid_number | project |
| Create with Daily in project Derivation rules - evaluation | 1 | 46279907250ec73b9b25a78031279680 |
| Create with Daily in project Derivation rules - Parallel | 2 | 35894775350ec7daa099378048029617 |
Scenario Outline: Delete 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_<sch_uid_number>"
And I request "project/46279907250ec73b9b25a78031279680/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 |
Scenario Outline: Create new Projects with event case scheduler
Given POST data from file "<project_template>"
And I request "projects"
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 "array"
And store "new_uid" in session array as variable "project_new_uid_<project_new_uid_number>" where an object has "object" equal to "project"
And store "new_uid" in session array as variable "diagram_new_uid_<project_new_uid_number>" where an object has "object" equal to "diagram"
And store "new_uid" in session array as variable "activity_new_uid_<project_new_uid_number>" where an object has "object" equal to "activity"
And store "new_uid" in session array as variable "evn_uid_<evn_uid_number>" where an object has "object" equal to "event"
And store "new_uid" in session array as variable "flow_new_uid_<project_new_uid_number>" where an object has "object" equal to "flow"
Examples:
| Description | project_new_uid_number | evn_uid_number | project_template |
| Create a new project with event case scheduler 1 | 1 | 3 | project_bug_case_scheduler1.json |
| Create a new project with event case scheduler 2 | 2 | 4 | project_bug_case_scheduler2.json |
Scenario Outline: Delete a Project previously created in this script
Given that I want to delete a resource with the key "new_uid" stored in session array as variable "project_new_uid_<project_new_uid_number>" in position 0
And I request "projects"
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:
| project_new_uid_number |
| 1 |
| 2 |

View File

@@ -26,12 +26,15 @@ Feature: Dynaform Main Tests
Scenario Outline: Normal Dynaform creation
Given POST this data:
Given POST a dynaform:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>"
"dyn_type": "<dyn_type>",
"dyn_content": "<dyn_content>",
"dyn_version": 1
}
"""
And I request "project/<project>/dynaform"
@@ -42,20 +45,45 @@ Feature: Dynaform Main Tests
And store "dyn_uid" in session array as variable "dyn_uid_<dyn_uid_number>"
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number |
| create dynaform xmlform P1 | 14414793652a5d718b65590036026581 | Dynaform - Normal | dyn normal P1 | xmlform | 1 |
| create dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid | dyn grid P1 | grid | 2 |
| create dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | xmlform | 3 |
| create dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | grid | 4 |
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_content | dyn_uid_number |
| create dynaform xmlform P1 | 14414793652a5d718b65590036026581 | Dynaform - Normal | dyn normal P1 | xmlform | sample content 1 | 1 |
| create dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid | dyn grid P1 | grid | sample content 2 | 2 |
| create dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | xmlform | | 3 |
| create dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | grid | sample content 4 | 4 |
Scenario Outline: Get a single dynaform and check some properties
Given that I want to get a resource with the key "dyn_uid" stored in session array as variable "dyn_uid_<dyn_uid_number>"
And I request "project/<project>/dynaform"
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 "dyn_title" is set to "<dyn_title>"
And that "dyn_description" is set to "<dyn_description>"
And that "dyn_type" is set to "<dyn_type>"
And that "dyn_content" is set to "<dyn_content>"
And that "dyn_version" is set to 1
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_content | dyn_uid_number |
| create dynaform xmlform P1 | 14414793652a5d718b65590036026581 | Dynaform - Normal | dyn normal P1 | xmlform | sample content 1 | 1 |
| create dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid | dyn grid P1 | grid | sample content 2 | 2 |
| create dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | xmlform | | 3 |
| create dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | grid | sample content 4 | 4 |
Scenario: Create dynaform with same name
Given POST this data:
Given POST a dynaform:
"""
{
"dyn_title": "Dynaform - Normal",
"dyn_description": "dyn normal P1",
"dyn_type": "xmlform"
"dyn_type": "xmlform",
"dyn_content": "sample content 1",
"dyn_version": 1
}
"""
And I request "project/14414793652a5d718b65590036026581/dynaform"
@@ -185,12 +213,15 @@ Feature: Dynaform Main Tests
Scenario Outline: Update the Dynaform and then check if the values had changed
Given PUT this data:
Given PUT a dynaform:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>"
"dyn_type": "<dyn_type>",
"dyn_content": "<dyn_content>",
"dyn_version": 1
}
"""
And that I want to update a resource with the key "dyn_uid" stored in session array as variable "dyn_uid_<dyn_uid_number>"
@@ -202,11 +233,11 @@ Feature: Dynaform Main Tests
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number |
| Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | 1 |
| Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | 2 |
| Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | 3 |
| Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | 4 |
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_content | dyn_uid_number |
| Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | update sample content 1 | 1 |
| Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | update sample content 2 | 2 |
| Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | sample | 3 |
| Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | sample content 4 | 4 |
@@ -220,14 +251,15 @@ Feature: Dynaform Main Tests
And that "dyn_title" is set to "<dyn_title>"
And that "dyn_description" is set to "<dyn_description>"
And that "dyn_type" is set to "<dyn_type>"
And that "dyn_content" is set to "<dyn_content>"
And that "dyn_version" is set to 1
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number |
| Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | 1 |
| Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | 2 |
| Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | 3 |
| Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | 4 |
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | dyn_content | dyn_uid_number |
| Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | update sample content 1 | 1 |
| Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | update sample content 2 | 2 |
| Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | sample | 3 |
| Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | sample content 4 | 4 |

View File

@@ -7,84 +7,119 @@ Feature: Dynaform Negative Tests
Scenario Outline: Normal Dynaform creation for a project with bad parameters (negative tests)
Given POST this data:
"""
Given POST this data:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>",
"dyn_content": "<dyn_content>",
"dyn_version": 1
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | error_code | error_message | dyn_content |
| Field required project | | Dynaform - Normal | dyn normal P1 | xmlform | 400 | prj_uid | sample 1 |
| Field required dyn_title | 14414793652a5d718b65590036026581 | | dyn grid P1 | grid | 400 | dyn_title | |
| Field required dyn_type | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | | 400 | dyn_type | sample 3 |
| Invalid dyn_type | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | graad | 400 | dyn_type | sample 4 |
Scenario: Normal Dynaform creation with wrong dyn_version (negative tests)
Given POST this data:
"""
{
"dyn_title": "dynaform",
"dyn_description": "version wrong",
"dyn_type": "xmlform",
"dyn_content": "ejemplo",
"dyn_version": 65
}
"""
And I request "project/14414793652a5d718b65590036026581/dynaform"
Then the response status code should be 400
And the response status message should have the following text "dyn_version"
Scenario: Normal Dynaform creation without dyn_version (negative tests)
Given POST this data:
"""
{
"dyn_title": "dynaform",
"dyn_description": "version wrong",
"dyn_type": "xmlform",
"dyn_content": "ejemplo",
"dyn_version": ""
}
"""
And I request "project/14414793652a5d718b65590036026581/dynaform"
Then the response status code should be 400
And the response status message should have the following text "dyn_version"
Scenario Outline: Create a Dynaform using the Copy/Import method for a project with bad parameters (negative tests)
Given POST this data:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>",
"copy_import":
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>"
"prj_uid": "<copy_prj_uid>",
"dyn_uid": "<copy_dyn_uid>"
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | error_code | error_message |
| Field required project | | Dynaform - Normal | dyn normal P1 | xmlform | 400 | prj_uid |
| Field required dyn_title | 14414793652a5d718b65590036026581 | | dyn grid P1 | grid | 400 | dyn_title |
| Field required dyn_type | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | | 400 | dyn_type |
| Invalid dyn_type | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | graad | 400 | dyn_type |
Examples:
Scenario Outline: Create a Dynaform using the Copy/Import method for a project with bad parameters (negative tests)
Given POST this data:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>",
"copy_import":
{
"prj_uid": "<copy_prj_uid>",
"dyn_uid": "<copy_dyn_uid>"
}
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | copy_prj_uid | copy_dyn_uid | error_code | error_message |
| invalid copy_prj_uid | 14414793652a5d718b65590036026581 | Dynaform - Copy 1 | dyn copy | xmlform | 42445320652cd0000000000000000085 | 70070685552cd53605650f7062918505 | 400 | copy_import.prj_uid |
| invalid copy_dyn_uid | 42445320652cd534acb3824056962285 | Dynaform - Copy 2 | dyn copy | xmlform | 14414793652a5d718b65590036026581 | 70070685500000000000000000000000 | 400 | copy_import.dyn_uid |
| test_description | project | dyn_title | dyn_description | dyn_type | copy_prj_uid | copy_dyn_uid | error_code | error_message |
| invalid copy_prj_uid | 14414793652a5d718b65590036026581 | Dynaform - Copy 1 | dyn copy | xmlform | 42445320652cd0000000000000000085 | 70070685552cd53605650f7062918505 | 400 | copy_import.prj_uid |
| invalid copy_dyn_uid | 42445320652cd534acb3824056962285 | Dynaform - Copy 2 | dyn copy | xmlform | 14414793652a5d718b65590036026581 | 70070685500000000000000000000000 | 400 | copy_import.dyn_uid |
Scenario Outline: Create dynaform based on a PMTable for a project with bad parameters (negative tests)
Given POST this data:
"""
Scenario Outline: Create dynaform based on a PMTable for a project with bad parameters (negative tests)
Given POST this data:
"""
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>",
"pmtable":
{
"dyn_title": "<dyn_title>",
"dyn_description": "<dyn_description>",
"dyn_type": "<dyn_type>",
"pmtable":
"tab_uid": "<tab_uid>",
"fields": [
{
"tab_uid": "<tab_uid>",
"fields": [
{
"fld_name": "<fld_name_01>",
"pro_variable": "<pro_variable_01>"
},
{
"fld_name": "<fld_name_02>",
"pro_variable": "<pro_variable_02>"
},
{
"fld_name": "<fld_name_03",
"pro_variable": "<pro_variable_03>"
}
]
"fld_name": "<fld_name_01>",
"pro_variable": "<pro_variable_01>"
},
{
"fld_name": "<fld_name_02>",
"pro_variable": "<pro_variable_02>"
},
{
"fld_name": "<fld_name_03",
"pro_variable": "<pro_variable_03>"
}
]
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
}
"""
And I request "project/<project>/dynaform"
Then the response status code should be <error_code>
And the response status message should have the following text "<error_message>"
Examples:
Examples:
| test_description | project | dyn_title | dyn_description | dyn_type | tab_uid | fld_name_01 | pro_variable_01 | fld_name_02 | pro_variable_02 | fld_name_03 | pro_variable_03 | error_code | error_message |
| invalid tab_uid | 14414793652a5d718b65590036026581 | Dynaform - pmtable 1 | dyn from pmtable | xmlform | 65193158852cc1a00000000000000000 | DYN_UID | @#APPLICATION | DYN_TITLE | @#TITLE | DYN_DESCRIPTION | @#DESCRIPTION | 400 | tab_uid |
| invalid fld_name_01 | 42445320652cd534acb3824056962285 | Dynaform - pmtable 2 | dyn from pmtable | xmlform | 65193158852cc1a93a5a535084878044 | DYN_INPUT | @#APPLICATION | DYN_TITLE | @#TITLE | DYN_DESCRIPTION | @#DESCRIPTION | 400 | fld_name |
| test_description | project | dyn_title | dyn_description | dyn_type | tab_uid | fld_name_01 | pro_variable_01 | fld_name_02 | pro_variable_02 | fld_name_03 | pro_variable_03 | error_code | error_message |
| invalid tab_uid | 14414793652a5d718b65590036026581 | Dynaform - pmtable 1 | dyn from pmtable | xmlform | 65193158852cc1a00000000000000000 | DYN_UID | @#APPLICATION | DYN_TITLE | @#TITLE | DYN_DESCRIPTION | @#DESCRIPTION | 400 | tab_uid |
| invalid fld_name_01 | 42445320652cd534acb3824056962285 | Dynaform - pmtable 2 | dyn from pmtable | xmlform | 65193158852cc1a93a5a535084878044 | DYN_INPUT | @#APPLICATION | DYN_TITLE | @#TITLE | DYN_DESCRIPTION | @#DESCRIPTION | 400 | fld_name |

View File

@@ -131,11 +131,11 @@ Scenario Outline: Upload files to same folders
And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
Examples:
| file | prf_path | prf_number |
|/home/wendy/uploadfiles/test1.html | templates | 4 |
|/home/wendy/uploadfiles/test2.html | templates | 5 |
|/home/wendy/uploadfiles/test.txt | public | 6 |
|/home/wendy/uploadfiles/TestQA.html| templates | 7 |
| file | prf_path | prf_number |
| /uploadfiles/test1.html | templates | 4 |
| /uploadfiles/test2.html | templates | 5 |
| /uploadfiles/test.txt | public | 6 |
| /uploadfiles/TestQA.html| templates | 7 |
Scenario Outline: Verify if TestQA was overwrited
@@ -216,12 +216,12 @@ Scenario Outline: Delete folder
#BUG 15207, The "Upload" accepts files with other extensions
#
#Scenario Outline: Upload files to same folders "Project - Process Complete BPMN"
# Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1455892245368ebeb11c1a5001393784/file-manager"
# And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
# And the response status message should have the following text "incorrect extension"
#
# Examples:
# | file | prf_path | prf_number |
# |/home/wendy/uploadfiles/SnagIt823.exe | templates | 1 |
Scenario Outline: Upload files to same folders "Project - Process Complete BPMN"
Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1455892245368ebeb11c1a5001393784/file-manager"
And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
And the response status message should have the following text "incorrect extension"
Examples:
| file | prf_path | prf_number |
| /uploadfiles/SnagIt823.exe | templates | 1 |

View File

@@ -137,7 +137,7 @@ Scenario: Get for Export Project
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/xml"
And save exported process to "/home/wendy/uploadfiles/" as "Process_Complete_BPMN"
And save exported process to "/uploadfiles/" as "Process_Complete_BPMN"
Scenario: Delete a Project created previously in this script
@@ -160,12 +160,12 @@ Scenario Outline: Import a process
Examples:
| project_file | import_option | prj_uid_number |
| /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | create | 1 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | create | 2 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | overwrite | 3 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | disable | 4 |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | keep | 5 |
| project_file | import_option | prj_uid_number |
| /uploadfiles/Process_NewCreate_BPMN.pmx | create | 1 |
| /uploadfiles/Process_Complete_BPMN.pmx | create | 2 |
| /uploadfiles/Process_Complete_BPMN.pmx | overwrite | 3 |
| /uploadfiles/Process_Complete_BPMN.pmx | disable | 4 |
| /uploadfiles/Process_Complete_BPMN.pmx | keep | 5 |
#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc.
@@ -413,8 +413,8 @@ Scenario Outline: Import a process
And the type is "object"
Examples:
| project_file | import_option |
| /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | create |
| project_file | import_option |
| /uploadfiles/Process_Complete_BPMN.pmx | create |
#For example, to export a empty process
@@ -424,7 +424,7 @@ Scenario: Get for Export Project "Export process empty"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/xml"
And save exported process to "/home/wendy/uploadfiles/" as "Export process empty"
And save exported process to "/uploadfiles/" as "Export process empty"
Scenario: Delete a Project created previously in this script "Export process empty"
Given that I want to delete a resource with the key "prj_uid" stored in session array
@@ -435,7 +435,7 @@ Scenario: Delete a Project created previously in this script "Export process emp
And the type is "object"
Scenario: Import a process "Export process empty"
Given POST upload a project file "/home/wendy/uploadfiles/Export_process_empty.pmx" to "project/import?option=create"
Given POST upload a project file "/uploadfiles/Export_process_empty.pmx" to "project/import?option=create"
Then the response status code should be 201
And the response charset is "UTF-8"
And the content type is "application/json"

View File

@@ -11,8 +11,8 @@ Scenario Outline: Import a process negative tests
Examples:
| Description | project_file | import_option | error_code | error_message |
| Import process when the process alredy exists | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | create | 400 | already exists |
| Description | project_file | import_option | error_code | error_message |
| Import process when the process alredy exists | /uploadfiles/Process_Complete_BPMN.pmx | create | 400 | already exists |
Scenario Outline: Import a process with wrong "option"
@@ -22,6 +22,6 @@ Scenario Outline: Import a process with wrong "option"
Examples:
| Description | project_file | option | option_group | error_message |
| Invalid option | /home/wendy/uploadfiles/Process_NewCreate_BPMN.pmx | sample | merge | option |
| Invalid option_group | /home/wendy/uploadfiles/Process_Complete_BPMN.pmx | create | sample | option_group |
| Description | project_file | option | option_group | error_message |
| Invalid option | /uploadfiles/Process_NewCreate_BPMN.pmx | sample | merge | option |
| Invalid option_group | /uploadfiles/Process_Complete_BPMN.pmx | create | sample | option_group |

View File

@@ -0,0 +1,145 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process variables Resources
Requirements:
a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded
there are three activities in the process
Background:
Given that I have a valid access_token
Scenario: Get a List of process variables
And I request "project/14414793652a5d718b65590036026581/process-variables"
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: Create variables for a Project (Normal creation of a process variable)
Given POST this data:
"""
{
"var_name": "<var_name>",
"var_field_type": "<var_field_type>",
"var_field_size": <var_field_size>,
"var_label": "<var_label>",
"var_dbconnection": "<var_dbconnection>",
"var_sql": "<var_sql>",
"var_null": <var_null>,
"var_default": "<var_default>",
"var_accepted_values": "<var_accepted_values>"
}
"""
And I request "project/14414793652a5d718b65590036026581/process-variable"
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 "var_uid" in session array as variable "var_uid_<var_uid_number>"
Examples:
| test_description | var_uid_number | var_name | var_field_type | var_field_size | var_label | var_dbconnection | var_sql | var_null | var_default | var_accepted_values |
| Create a integer | 1 | integer1 | integer | 12 | Texto 1 | | | 0 | | |
| Create a boolean | 2 | boolean1 | boolean | 10 | Fecha | | | 0 | | |
| Create a string | 3 | string1 | string | 12 | Dropdown 1 | | SELECT IC_UID, IC_NAME FROM ISO_COUNTRY | 0 | | |
| Create a float | 4 | float1 | float | 12 | Texto 1 | | | 0 | | |
| Create a datetime | 5 | datetime1 | datetime | 12 | Texto 1 | | | 0 | | |
| Create a date_of_birth | 6 | date_of_birth1 | date_of_birth | 12 | Texto 1 | | | 0 | | |
Scenario Outline: Update a process variable
Given PUT this data:
"""
{
"var_field_type": "<var_field_type>",
"var_field_size": <var_field_size>,
"var_label": "<var_label>",
"var_dbconnection": "<var_dbconnection>",
"var_sql": "<var_sql>",
"var_null": <var_null>,
"var_default": "<var_default>",
"var_accepted_values": "<var_accepted_values>"
}
"""
And that I want to update a resource with the key "var_uid" stored in session array as variable "var_uid_<var_uid_number>"
And I request "project/14414793652a5d718b65590036026581/process-variable"
And the content type is "application/json"
Then the response status code should be 200
Examples:
| test_description | var_uid_number | var_field_type | var_field_size | var_label | var_dbconnection | var_sql | var_null | var_default | var_accepted_values |
| Update a text | 1 | text | 12 | Texto 1 - Updated | | | 0 | | |
| Update a date | 2 | date | 10 | Fecha - Updated | | | 0 | | |
| Update a dropdown | 3 | dropdown | 12 | Dropdown 1 - Updated | | SELECT IC_UID, IC_NAME FROM ISO_COUNTRY | 0 | | |
Scenario: Get a List of process variables
And I request "project/14414793652a5d718b65590036026581/process-variables"
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"
Scenario Outline: Get a single process variable
And that I want to get a resource with the key "var_uid" stored in session array as variable "var_uid_<var_uid_number>"
And I request "project/14414793652a5d718b65590036026581/process-variable"
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 | var_uid_number | var_name | var_field_type | var_field_size | var_label | var_dbconnection | var_sql | var_null | var_default | var_accepted_values |
| Update a text | 1 | texto1 | text | 12 | Texto 1 - Updated | | | 0 | | |
| Update a date | 2 | date1 | date | 10 | Fecha - Updated | | | 0 | | |
| Update a dropdown | 3 | dropdown1 | dropdown | 12 | Dropdown 1 - Updated | | SELECT IC_UID, IC_NAME FROM ISO_COUNTRY | 0 | | |
Scenario Outline: Execute query of variables with SQL
Given POST this data:
"""
{
}
"""
And I request "project/14414793652a5d718b65590036026581/process-variable/<var_name>/execute-query"
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"
Examples:
| test_description | var_uid_number | var_name | var_field_type | var_field_size | var_label | var_dbconnection | var_sql | var_null | var_default | var_accepted_values |
| Create a dropdown | 3 | string1 | string | 12 | Dropdown 1 | | SELECT IC_UID, IC_NAME FROM ISO_COUNTRY | 0 | | |
Scenario Outline: Delete a previously created process variable
Given that I want to delete a resource with the key "var_uid" stored in session array as variable "var_uid_<var_uid_number>"
And I request "project/14414793652a5d718b65590036026581/process-variable"
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 | var_uid_number |
| Create a integer | 1 |
| Create a boolean | 2 |
| Create a string | 3 |
| Create a float | 4 |
| Create a datetime | 5 |
| Create a date_of_birth | 6 |
Scenario: Get a List of process variables
And I request "project/14414793652a5d718b65590036026581/process-variables"
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

View File

@@ -1362,6 +1362,7 @@ class RestContext extends BehatContext
*/
public function postIWantToUploadTheFileToPathPublicUrl($prfFile, $prfPath, $url)
{
$prfFile = sys_get_temp_dir() . $prfFile;
$baseUrl = $this->getParameter('base_url');
$url = $baseUrl.$url;
$accesstoken = $this->getParameter('access_token');
@@ -1421,6 +1422,7 @@ class RestContext extends BehatContext
*/
public function postIWantToUploadTheImageToUser($imageFile, $usrUid, $url)
{
$imageFile = sys_get_temp_dir() . $imageFile;
$baseUrl = $this->getParameter('base_url');
$url = $baseUrl.$url.$usrUid."/image-upload";
@@ -1462,6 +1464,7 @@ class RestContext extends BehatContext
}
$usrUid = $varValue;
$imageFile = sys_get_temp_dir() . $imageFile;
$this->postIWantToUploadTheImageToUser($imageFile, $usrUid, $url);
}
@@ -1518,6 +1521,7 @@ class RestContext extends BehatContext
*/
public function postUploadAnInputDocumentTo($file, $url, PyStringNode $string)
{
$file = sys_get_temp_dir() . $file;
$postFields = json_decode($string);
$postFields->form ='@'.$file;
@@ -1533,6 +1537,7 @@ class RestContext extends BehatContext
*/
public function postUploadAProjectFile($file, $url)
{
$file = sys_get_temp_dir() . $file;
$postFields = new StdClass();
$postFields->project_file ='@'.$file;
@@ -1637,7 +1642,7 @@ class RestContext extends BehatContext
}
$destinationFolder = sys_get_temp_dir() . $destinationFolder;
$exportedProcessFileName = $destinationFolder.str_replace(" ","_",$exportedProcessFileName).".pmx";
$this->printDebug("Exporting process to: $exportedProcessFileName");
@@ -1646,6 +1651,50 @@ class RestContext extends BehatContext
chmod($exportedProcessFileName, 0777);
}
/**
* @Given /^POST a dynaform:$/
*/
public function postADynaform(PyStringNode $string)
{
$postFields = json_decode($string);
if ((isset($postFields->dyn_content))&&(file_exists(sys_get_temp_dir() . $postFields->dyn_content))) {
$postFields->dyn_content = sys_get_temp_dir() . $postFields->dyn_content;
$this->printDebug("Extracting dyanform content from: ".$postFields->dyn_content."\n");
$postFields->dyn_content = file_get_contents($postFields->dyn_content);
$string = json_encode($postFields);
}
$this->_restObjectMethod = 'post';
$this->_headers['Content-Type'] = 'application/json; charset=UTF-8';
$this->_requestBody = $string;
}
/**
* @Given /^PUT a dynaform:$/
*/
public function putADynaform(PyStringNode $string)
{
$postFields = json_decode($string);
if ((isset($postFields->dyn_content))&&(file_exists(sys_get_temp_dir() . $postFields->dyn_content))) {
$postFields->dyn_content = sys_get_temp_dir() . $postFields->dyn_content;
$this->printDebug("Extracting dyanform content from: ".$postFields->dyn_content."\n");
$postFields->dyn_content = file_get_contents($postFields->dyn_content);
$string = json_encode($postFields);
}
$this->_restObjectMethod = 'put';
$this->_headers['Content-Type'] = 'application/json; charset=UTF-8';
$this->_requestBody = $string;
}
/**