Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Freddy Daniel Rojas Valda
2014-05-08 11:38:09 -04:00
10 changed files with 270 additions and 108 deletions

View File

@@ -66,8 +66,9 @@ Scenario Outline: Create new pmtable
Examples:
| test_description | pmt_uid_number | pmt_tab_name | pmt_tab_dsc |
| Create pmtable with fields defined | 1 | PMT_Test_QA | pmt table created with script |
| test_description | pmt_uid_number | pmt_tab_name | pmt_tab_dsc |
| Create pmtable with fields defined | 1 | PMT_Test_QA | pmt table created with script |
| Create pmtable for test data | 2 | PMT_DAT_QA | pmt para realizar el testeo del borrado del data |
Scenario Outline: Create a new Data of pm table.
@@ -88,6 +89,42 @@ Scenario Outline: Create a new Data of pm table.
| pmt_uid_number |
| 1 |
| 2 |
Scenario Outline: Update a a data of pm table
Given PUT this data:
"""
{
"CAMPO1" : "valor1",
"CAMPO2" : "updatevalor2"
}
"""
And that I want to update a "PM Table"
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| pmt_uid_number |
| 1 |
Scenario Outline: Get data of the PMTABLE
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
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 that "CAMPO1" is set to "valor1"
And that "CAMPO2" is set to "updatevalor2"
Examples:
| pmt_uid_number |
| 1 |
Scenario Outline: Update a pm table of a project
@@ -136,49 +173,63 @@ Examples:
| 1 |
Scenario Outline: Update a a data of pm table
Given PUT this data:
"""
{
"CAMPO1" : "valor1",
"CAMPO2" : "updatevalor2"
}
"""
And that I want to update a "PM Table"
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| pmt_uid_number |
| 1 |
Scenario Outline: Get data of the PMTABLE
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
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 that "CAMPO1" is set to "valor1"
And that "CAMPO2" is set to "updatevalor2"
Examples:
| pmt_uid_number |
| 1 |
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace
Given I request "pmtable"
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 response has 3 records
#Test delete of Data
Scenario Outline: Update a pm table of a project
Given PUT this data:
"""
{
"rep_tab_dsc" : "descripcion de la tabla",
"fields" : [
{
"fld_key" : 1,
"fld_name" : "UPDATECAMPO",
"fld_label" : "UPDATECAMPO",
"fld_type" : "VARCHAR",
"fld_size" : 200
}
]
}
"""
And that I want to update a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| pmt_uid_number |
| 2 |
Scenario Outline: Get a single the PMTABLE after update
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
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 response has 0 records
Examples:
| pmt_uid_number |
| 2 |
#Delete PM Tables
Scenario Outline: Delete a pm table of a pmtable
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
@@ -191,20 +242,7 @@ Scenario Outline: Delete a pm table of a pmtable
| pmt_uid_number |
| 1 |
Scenario Outline: Delete a data of a pmtable
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable/<pmt_uid>/data/CAMPO1/valor1"
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:
| pmt_uid_number |
| 1 |
| 2 |
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace

View File

@@ -117,9 +117,9 @@ Scenario Outline: Create a new Data of pm table.
Given POST this data:
"""
{
"UNO" : "<pmt_uid_number>",
"CAMPO1" : "QA",
"CAMPO2" : "<CAMPO2>"
"UNO" : "QA11",
"DOS" : "QA22",
"TRES" : "QA33"
}
"""
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
@@ -130,14 +130,54 @@ Scenario Outline: Create a new Data of pm table.
Examples:
| pmt_uid_number | CAMPO2 |
| 1 | DEV1 |
| 2 | DEV2 |
| 3 | DEV3 |
| 4 | DEV4 |
| 5 | DEV5 |
| 6 | DEV6 |
| 7 | DEV7 |
| pmt_uid_number |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
Scenario Outline: Update a a data of pm table
Given PUT this data:
"""
{
"UNO" : "UPDATE QA11",
"DOS" : "UPDATE QA22",
"TRES" : "UPDATE QA33"
}
"""
And that I want to update "PM Table"
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| pmt_uid_number |
| 1 |
| 4 |
| 6 |
Scenario Outline: Get data of the PMTABLE
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
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 that "CAMPO1" is set to "QA"
And that "CAMPO2" is set to "CAMPO2"
Examples:
| pmt_uid_number | CAMPO2 |
| 1 | UPDATE QA11 |
| 4 | UPDATE QA22 |
| 6 | UPDATE QA33 |
Scenario Outline: Update a pm table of a project
@@ -189,55 +229,80 @@ Scenario Outline: Get a single the PMTABLE after update
| 6 | UPDATESEIS | UPDATESEIS | VARCHAR |
Scenario Outline: Update a a data of pm table
Given PUT this data:
"""
{
"UNO" : "<pmt_uid_number>",
"CAMPO1" : "QA",
"CAMPO2" : "<CAMPO2>"
}
"""
And that I want to update "PM Table"
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| pmt_uid_number | CAMPO2 |
| 1 | UPDATEQA2 |
| 4 | UPDATEQA4 |
| 6 | UPDATEQA6 |
Scenario Outline: Get data of the PMTABLE
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
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 that "CAMPO1" is set to "QA"
And that "CAMPO2" is set to "CAMPO2"
Examples:
| pmt_uid_number | CAMPO2 |
| 1 | UPDATEQA2 |
| 4 | UPDATEQA4 |
| 6 | UPDATEQA6 |
Scenario: Get the PMTABLE List when there are exactly two pmtables in this workspace
Given I request "pmtable"
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 response has 8 records
#Test Delete of data
Scenario Outline: Update a pm table of a project
Given PUT this data:
"""
{
"rep_tab_dsc" : "descripcion de la tabla",
"fields" : [
{
"fld_key" : 1,
"fld_name" : "<fld_name>",
"fld_label" : "<fld_label>",
"fld_type" : "<fld_type>",
"fld_size" : 200
}
]
}
"""
And that I want to update a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| Description | pmt_uid_number | fld_name | fld_label | fld_type |
| Update a pmtable 1 | 4 | UPDATEUNO | UPDATEUNO | VARCHAR |
| Update a pmtable 3 | 5 | UPDATETRES | UPDATETRES | VARCHAR |
| Update a pmtable 6 | 7 | UPDATESEIS | UPDATESEIS | VARCHAR |
Scenario Outline: Get a single the PMTABLE after update
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
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 that "fld_name" is set to "<fld_name>"
And that "fld_label" is set to "<fld_label>"
And that "fld_type" is set to "<fld_type>"
Examples:
| pmt_uid_number | fld_name | fld_label | fld_type |
| 4 | UPDATEUNO | UPDATEUNO | VARCHAR |
| 5 | UPDATETRES | UPDATETRES | VARCHAR |
| 7 | UPDATESEIS | UPDATESEIS | VARCHAR |
Scenario Outline: Get a single the PMTABLE after update
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
And I request "pmtable"
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 response has 0 records
Examples:
| pmt_uid_number |
| 4 |
| 5 |
| 7 |
Scenario Outline: Delete a pm table of a pmtable
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
@@ -270,7 +335,7 @@ Scenario Outline: Delete a data of a pmtable
Examples:
| pmt_uid_number |
| 1 |
| 2 |
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace

View File

@@ -238,7 +238,6 @@ Scenario Outline: Route a case to the next task in the process
Given PUT this data:
"""
{
"case_uid": "<case_number>",
"del_index": "1"
}
"""

View File

@@ -207,7 +207,6 @@ Scenario Outline: Create new Projects (Negative Tests)
| Description | prj_name | prj_description | act_name | act_type | evn_name | evn_marker | error_code | error_message |
| Field required prj_name | | Prueba | Task # 1 | TASK | End # 1 | EMPTY | 400 | prj_name |
| Field required prj_description | Test negative project 1 | | Task # 1 | TASK | End # 1 | EMPTY | 400 | prj_description |
| Field required act_name | Test negative project 2 | Prueba 1 | | TASK | End # 1 | EMPTY | 400 | act_name |
| Field required act_type | Test negative project 3 | Prueba 2 | Task # 1 | | End # 1 | EMPTY | 400 | act_type |
| Field required evn_name | Test negative project 4 | Prueba 3 | Task # 1 | TASK | | EMPTY | 400 | evn_name |

View File

@@ -0,0 +1,17 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Export Process Main Tests
Requirements:
a workspace with the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN") already loaded
there are many activities, steps, triggers, pmtables, asignee, events, etc. in the process
Background:
Given that I have a valid access_token
Scenario: Get for Export Project
Given I request "project/1455892245368ebeb11c1a5001393784/export"
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"

View File

@@ -0,0 +1,29 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Import Process Main Tests
Requirements:
a workspace without the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN") already loaded
there are many activities, steps, triggers, pmtables, asignee, events, etc. in the process
Background:
Given that I have a valid access_token
Scenario: Get for Export Project
Given I request "project/1455892245368ebeb11c1a5001393784/export"
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 Outline: Import a process
Given POST upload a project file "<project_file>" to "project/import?option=<import_option>"
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"
Examples:
| project_file | import_option |
| /home/wendy/processFiles/process1.pmx | create |

View File

@@ -1526,6 +1526,21 @@ class RestContext extends BehatContext
$this->iRequest($url);
}
/**
* @Given /^POST upload a project file "([^"]*)" to "([^"]*)"$/
*/
public function postUploadAProjectFile($file, $url, PyStringNode $string)
{
$postFields = json_decode($string);
$postFields->project_file ='@'.$file;
$this->_restObjectMethod = 'post';
$this->_restObject = $postFields;
$this->iRequest($url);
}

View File

@@ -27,7 +27,7 @@
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
if(sizeof($output) == 3) {
if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
define("COLUMNS", $output[2][0]);
} else {
define("COLUMNS", 80);