Avance de los features case note, case variables, input document case, output document case

This commit is contained in:
Wendy Nestor
2014-04-01 08:52:37 -04:00
parent 6898dc3157
commit 41516719ab
19 changed files with 707 additions and 200 deletions

View File

@@ -105,7 +105,7 @@ Scenario Outline: Reassigns a case to a different user
}
"""
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
And I request "case/app_uid/reassign-case" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
And I request "cases/app_uid/reassign-case" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
@@ -116,14 +116,98 @@ Scenario Outline: Reassigns a case to a different user
| Description | app_uid_number | usr_uid_source | usr_uid_target |
| Reassign the user adam | 1 | 00000000000000000000000000000001 | 44811996752d567110634a1013636964 |
| Reassign the user aaron | 2 | 00000000000000000000000000000001 | 51049032352d56710347233042615067 |
| Reassign the user jeremiah | 3 | 00000000000000000000000000000001 | 86677227852d5671f40ba25017213081 |
| Reassign the user chris | 4 | 00000000000000000000000000000001 | 24166330352d56730cdd525035621101 |
| Reassign the user zachary | 5 | 00000000000000000000000000000001 | 62625000752d5672d6661e6072881167 |
| Reassign the user admin | 6 | 24166330352d56730cdd525035621101 | 00000000000000000000000000000001 |
| Reassign the user admin | 7 | 44811996752d567110634a1013636964 | 00000000000000000000000000000001 |
| Reassign the user admin | 8 | 51049032352d56710347233042615067 | 00000000000000000000000000000001 |
| Reassign the user admin | 9 | 86677227852d5671f40ba25017213081 | 00000000000000000000000000000001 |
| Reassign the user admin | 10 | 62625000752d5672d6661e6072881167 | 00000000000000000000000000000001 |
Scenario Outline: Cancel a case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
And I request "cases/app_uid/cancel" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_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:
| Description | app_uid_number |
| Cancel of the process "Derivation rules - Parallel" | 3 |
| Cancel of the process "Derivation rules - parallel evaluation" | 5 |
| Cancel of the process "Derivation rules - selection" | 10 |
Scenario Outline: Pause a case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
And I request "cases/app_uid/pause" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_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:
| Description | app_uid_number |
| Pause of the process "Derivation rules - parallel evaluation" | 4 |
| Pause of the process "Derivation rules - Parallel" | 8 |
| Pause of the process "Derivation rules - parallel evaluation" | 9 |
Scenario Outline: Unpause a case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
And I request "cases/app_uid/unpause" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_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:
| Description | app_uid_number |
| Unpause of the process "Derivation rules - parallel evaluation" | 4 |
| Unpause of the process "Derivation rules - Parallel" | 8 |
| Unpause of the process "Derivation rules - parallel evaluation" | 9 |
Scenario Outline: Trigger a case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
And I request "cases/app_uid/execute-trigger/{tri_uid}" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_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:
| Description | app_uid_number |
| | |
| | |
| | |
Scenario Outline: Route a case to the next task in the process
@@ -153,3 +237,28 @@ Scenario Outline: Route a case to the next task in the process
| Route next activity "Derivation rules - Parallel" | 8 |
| Route next activity "Derivation rules - parallel evaluation" | 9 |
| Route next activity "Derivation rules - selection" | 10 |
Scenario Outline: Delete of the cases created in this script.
Given that I want to delete a resource with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
And I request "cases/551390121533343ee886813057396196/output-document"
And 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:
| app_doc_uid_number |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |

View File

@@ -1,85 +0,0 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Actions - the features in this script are (cancelCase, pauseCase, unpaseCase, executeCase, executeCase, executeTrigger and Delete Case)
Requirements:
a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point"
Background:
Given that I have a valid access_token
Scenario: Cancel Case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "" stored in session array
And I request "case/{uid}/cancel-case"
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"
Scenario: Pause Case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "" stored in session array
And I request "case/{uid}/pause-case"
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"
Scenario: Unpause Case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "" stored in session array
And I request "case/{uid}/unpause-case"
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"
Scenario: Executes a ProcessMaker trigger for a case
Given POST this data:
"""
{
}
"""
And I request "case{uid}/execute-trigger"
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 "" in session array
Scenario: Delete case of workspace
Given that I want to delete a resource with the key "" stored in session array
And I request "case/{uid}/unpause-case"
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"

View File

@@ -1,68 +1,38 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Notes
Requirements:
a workspace with three cases of the process "Test Users-Step-Properties End Point"
a workspace with one case of the process "Test Case Note"
Background:
Given that I have a valid access_token
Scenario: List of case notes for this case
Given I request "case/{uid}/notes"
Given I request "cases/1185553665335d2e209f723099733152/notes"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
Scenario: Get a List of cases notes of a case with paged
Given I request "cases/1185553665335d2e209f723099733152/notes/paged"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
Scenario: create a new case note for specified case
Scenario: Create a new case note for specified case
Given POST this data:
"""
{
"note_content": "tercer case note creado desde script",
"send_email": 1
}
"""
And I request "case/{uid}/case"
And I request "cases/1185553665335d2e209f723099733152/note"
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 "" in session array
Scenario: Get a specified case note for this case
Given that I want to get a resource with the key "" stored in session array
Given I request "case/{uid}/note/{uid}"
Then the response status code should be 200
And the response charset is "UTF-8"
And the " property equals ""
And the "" property equals ""
Scenario: Modify a case note for specified case
Given PUT this data:
"""
{
}
"""
And that I want to update a resource with the key "" stored in session array
And I request "case/{uid}/case/{uid}"
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"
Scenario: Delete a case note for specified case
Given that I want to delete a resource with the key "" stored in session array
And I request "case/{uid}/case/{uid}"
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"
#case 125

View File

@@ -0,0 +1,30 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Notes
Requirements:
a workspace with one case of the process "Test Case Note"
Background:
Given that I have a valid access_token
Scenario: List of case notes for this case
Given I request "cases/{uid}/notes"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
Scenario Outline: Create a new case note for specified case
Given POST this data:
"""
{
"note_content": "tercer case note creado desde script",
"send_email": 1
}
"""
And I request "case/{uid}/case"
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"

View File

@@ -0,0 +1,27 @@
ProcessMakerMichelangelo @RestAPI
Feature: Case Note Negative Tests
Requirements:
a workspace with three cases of the process "Test Users-Step-Properties End Point"
Background:
Given that I have a valid access_token
Scenario: create a new case note for specified case (Negative Tests)
Given POST this data:
"""
{
"note_content": "prueba de creacion de un case note, sn permisos para poder enviar",
"send_email": 1
}
"""
And I request "cases/6441974235335ced24785c4035070430/note"
Then the response status code should be 400
And the response status message should have the following text "You do not have permission to cases notes"
#case 124

View File

@@ -1,31 +1,88 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Variables
Requirements:
a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point"
a workspace with five cases of the process "Test Case Variables" and with one case in workspace
Background:
Given that I have a valid access_token
Scenario: Returns the variables can be system variables and/or case variables.
Given I request "case/{uid}/get-variables"
Given I request "cases/95124734553388becc0e332080057699/variables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the type is "object"
Scenario: Sends variables to a case
Given PUT this data:
"""
{
"nameany": "sample-put",
"namealphabetic": "juanput",
"namealphanumeric": "sample123put",
"nameinteger": "1313200000",
"namerealnumber": "4324325000put",
"nameemail": "qa@colosaput.com",
"namelogin": "sampleput",
"valorreal": "32,142,424.00",
"valorinteger": "4,242,424",
"porcentagereal": "424.00 %",
"porcentageinteger": "424 %",
"observaciones": "ningunaput",
"grid": {
"1": {
"sample": "unoput",
"currency1": "133,000.00",
"percentage1": "424.00 %"
}
}
}
"""
And that I want to update a resource with the key "" stored in session array
And I request "case/{uid}/send-variables"
And I request "cases/95124734553388becc0e332080057699/variable"
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"
And the type is "object"
Scenario: Return variables to a case
Given PUT this data:
"""
{
"nameany": "sample",
"namealphabetic": "juan",
"namealphanumeric": "sample123",
"nameinteger": "12345",
"namerealnumber": "12344.56",
"nameemail": "qa@colosa.com",
"namelogin": "sample",
"valorreal": "12,344,556,778.00",
"valorinteger": "1,223,445",
"porcentagereal": "122.44 %",
"porcentageinteger": "123 %",
"observaciones": "Observaciones",
"grid": {
"1": {
"sample": "jose",
"currency1": "12,334,444.00",
"percentage1": "333.00 %"
}
}
}
"""
And I request "cases/95124734553388becc0e332080057699/variable"
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"
Scenario: Returns the variables can be system variables and/or case variables.
Given I request "cases/95124734553388becc0e332080057699/variables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
#guardar el caso 128-->volver a ejecutar otro caso

View File

@@ -0,0 +1,274 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Variables
Requirements:
a workspace with five cases of the process "Test Case Variables" and with one case in workspace
Background:
Given that I have a valid access_token
#case 128
Scenario: Returns the variables can be system variables and/or case variables.
Given I request "cases/95124734553388becc0e332080057699/variables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "nameany" property equals "sample"
And the "namealphabetic" property equals "juan"
And the "namealphanumeric" property equals "sample123"
And the "nameinteger" property equals "12345"
And the "namerealnumber" property equals "12344.56"
And the "nameemail" property equals "qa@colosa.com"
And the "namelogin" property equals "sample"
And the "valorreal" property equals "12,344,556,778.00"
And the "valorinteger" property equals "1,223,445"
And the "porcentagereal" property equals "122.44 %"
And the "porcentageinteger" property equals "123 %"
And the "observaciones" property equals "Observaciones"
And the "areascolosa" property equals "desarrollo"
And the "areascolosa_label" property equals "Desarrollo"
And the "COUNTRY" property equals "BO"
And the "COUNTRY_label" property equals "Bolivia"
And the "STATE" property equals "H"
And the "STATE_label" property equals "Chuquisaca"
And the "LOCATION" property equals "SRE"
And the "LOCATION_label" property equals "Sucre"
And the "aprobado" property equals "1"
And the "aprobadohint" property equals "0"
And the "checkbox1" property equals "On"
And the "checkbox2" property equals "Off"
And the "checkbox3" property equals "Off"
And the "radiogroup1" property equals "primero"
And the "radiogroup1_label" property equals "Primero"
And the "radiogroup2" property equals "quinto"
And the "radiogroup2_label" property equals "Quinto"
And the "date1" property equals "2013-11-07"
And the "date2" property equals "2013-11-08"
And the "date3" property equals "2014-03-03"
And the "date4" property equals "2014-03-01"
And the "suggest2" property equals "51049032352d56710347233042615067"
And the "suggest2_label" property equals "aaron"
And the "sample" property in row 1 of property "grid" equals "jose"
And the "currency1" property equals "12,334,444.00"
And the "percentage1" property equals "333.00 %"
And the "suggest1_label" property equals "gavin"
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
And the "textarea1" property equals "ninguno"
And the "dropdown1" property equals "dos"
And the "dropdown1_label" property equals "dos"
And the "yesno1" property equals "1"
And the "checkbox1" property equals "On"
And the "date1" property equals "2014-03-13"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"
And the "sample" property equals "maria"
And the "currency1" property equals "132,424.00"
And the "percentage1" property equals "344.00 %"
And the "suggest1_label" property equals "emily"
And the "suggest1" property equals "34289569752d5673d310e82094574281"
And the "textarea1" property equals "sample"
And the "dropdown1" property equals "uno"
And the "dropdown1_label" property equals "uno"
And the "yesno1" property equals "0"
And the "checkbox1" property equals "Off"
And the "date1" property equals "2014-03-29"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"
Scenario: Sends variables to a case
Given PUT this data:
"""
{
"nameany": "sample-put",
"namealphabetic": "juanput",
"namealphanumeric": "sample123567",
"nameinteger": "1313200000",
"namerealnumber": "4324325000567.12",
"nameemail": "qa@colosaput.com",
"namelogin": "sampleput",
"valorreal": "32,142,424.00",
"porcentagereal": "424.00 %",
"observaciones": "ningunaput",
"grid": {
"1": {
"sample": "unoput",
"currency1": "133,000.00",
"percentage1": "424.00 %"
}
}
}
"""
And I request "cases/95124734553388becc0e332080057699/variable"
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"
Scenario: Returns the variables can be system variables and/or case variables.
Given I request "cases/95124734553388becc0e332080057699/variables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "nameany" property equals "sample-put"
And the "namealphabetic" property equals "juan-put"
And the "namealphanumeric" property equals "sample123567"
And the "nameinteger" property equals "1313200000"
And the "namerealnumber" property equals "4324325000567.12"
And the "nameemail" property equals "qa@colosaput.com"
And the "namelogin" property equals "sampleput"
And the "valorreal" property equals "32,142,424.00"
And the "valorinteger" property equals "1,223,445"
And the "porcentagereal" property equals "424.00 %"
And the "porcentageinteger" property equals "123 %"
And the "observaciones" property equals "ningunaput"
And the "areascolosa" property equals "desarrollo"
And the "areascolosa_label" property equals "Desarrollo"
And the "COUNTRY" property equals "BO"
And the "COUNTRY_label" property equals "Bolivia"
And the "STATE" property equals "H"
And the "STATE_label" property equals "Chuquisaca"
And the "LOCATION" property equals "SRE"
And the "LOCATION_label" property equals "Sucre"
And the "aprobado" property equals "1"
And the "aprobadohint" property equals "0"
And the "checkbox1" property equals "On"
And the "checkbox2" property equals "Off"
And the "checkbox3" property equals "Off"
And the "radiogroup1" property equals "primero"
And the "radiogroup1_label" property equals "Primero"
And the "radiogroup2" property equals "quinto"
And the "radiogroup2_label" property equals "Quinto"
And the "date1" property equals "2013-11-07"
And the "date2" property equals "2013-11-08"
And the "date3" property equals "2014-03-03"
And the "date4" property equals "2014-03-01"
And the "suggest2" property equals "51049032352d56710347233042615067"
And the "suggest2_label" property equals "aaron"
And the "sample" property equals "unoput"
And the "currency1" property equals "133,000.00"
And the "percentage1" property equals "424.00 %"
And the "suggest1_label" property equals "gavin"
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
And the "textarea1" property equals "ninguno"
And the "dropdown1" property equals "dos"
And the "dropdown1_label" property equals "dos"
And the "yesno1" property equals "1"
And the "checkbox1" property equals "On"
And the "date1" property equals "2014-03-13"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"
And the "sample" property equals "maria"
And the "currency1" property equals "132,424.00"
And the "percentage1" property equals "344.00 %"
And the "suggest1_label" property equals "emily"
And the "suggest1" property equals "34289569752d5673d310e82094574281"
And the "textarea1" property equals "sample"
And the "dropdown1" property equals "uno"
And the "dropdown1_label" property equals "uno"
And the "yesno1" property equals "0"
And the "checkbox1" property equals "Off"
And the "date1" property equals "2014-03-29"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"
Scenario: Return variables to a case
Given PUT this data:
"""
{
"nameany": "sample",
"namealphabetic": "juan",
"namealphanumeric": "sample123",
"nameinteger": "12345",
"namerealnumber": "12344.56",
"nameemail": "qa@colosa.com",
"namelogin": "sample",
"valorreal": "12,344,556,778.00",
"porcentagereal": "122.44 %",
"observaciones": "Observaciones",
"grid": {
"1": {
"sample": "jose",
"currency1": "12,334,444.00",
"percentage1": "333.00 %"
}
}
}
"""
And I request "cases/95124734553388becc0e332080057699/variable"
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"
Scenario: Returns the variables can be system variables and/or case variables.
Given I request "cases/95124734553388becc0e332080057699/variables"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "nameany" property equals "sample"
And the "namealphabetic" property equals "juan"
And the "namealphanumeric" property equals "sample123"
And the "nameinteger" property equals "12345"
And the "namerealnumber" property equals "12344.56"
And the "nameemail" property equals "qa@colosa.com"
And the "namelogin" property equals "sample"
And the "valorreal" property equals "12,344,556,778.00"
And the "valorinteger" property equals "1,223,445"
And the "porcentagereal" property equals "122.44 %"
And the "porcentageinteger" property equals "123 %"
And the "observaciones" property equals "Observaciones"
And the "areascolosa" property equals "desarrollo"
And the "areascolosa_label" property equals "Desarrollo"
And the "COUNTRY" property equals "BO"
And the "COUNTRY_label" property equals "Bolivia"
And the "STATE" property equals "H"
And the "STATE_label" property equals "Chuquisaca"
And the "LOCATION" property equals "SRE"
And the "LOCATION_label" property equals "Sucre"
And the "aprobado" property equals "1"
And the "aprobadohint" property equals "0"
And the "checkbox1" property equals "On"
And the "checkbox2" property equals "Off"
And the "checkbox3" property equals "Off"
And the "radiogroup1" property equals "primero"
And the "radiogroup1_label" property equals "Primero"
And the "radiogroup2" property equals "quinto"
And the "radiogroup2_label" property equals "Quinto"
And the "date1" property equals "2013-11-07"
And the "date2" property equals "2013-11-08"
And the "date3" property equals "2014-03-03"
And the "date4" property equals "2014-03-01"
And the "suggest2" property equals "51049032352d56710347233042615067"
And the "suggest2_label" property equals "aaron"
And the "sample" property equals "jose"
And the "currency1" property equals "12,334,444.00"
And the "percentage1" property equals "333.00 %"
And the "suggest1_label" property equals "gavin"
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
And the "textarea1" property equals "ninguno"
And the "dropdown1" property equals "dos"
And the "dropdown1_label" property equals "dos"
And the "yesno1" property equals "1"
And the "checkbox1" property equals "On"
And the "date1" property equals "2014-03-13"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"
And the "sample" property equals "maria"
And the "currency1" property equals "132,424.00"
And the "percentage1" property equals "344.00 %"
And the "suggest1_label" property equals "emily"
And the "suggest1" property equals "34289569752d5673d310e82094574281"
And the "textarea1" property equals "sample"
And the "dropdown1" property equals "uno"
And the "dropdown1_label" property equals "uno"
And the "yesno1" property equals "0"
And the "checkbox1" property equals "Off"
And the "date1" property equals "2014-03-29"
And the "link1" property equals "http://www.google.com/"
And the "link1_label" property equals "link1"

View File

@@ -0,0 +1,95 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Cases Variables Negative Tests
Background:
Given that I have a valid access_token
Scenario: Returns the variables can be system variables and/or case variables (negative tests).
Given I request "cases/95124734553388becc0e332080057699/variable"
Then the response status code should be 400
And the response status message should have the following text "Not Found"
Scenario: Sends variables to a case (negative tests)
Given PUT this data:
"""
{
"nameany": "sample-put",
"namealphabetic": "juanput",
"namealphanumeric": "sample123put",
"nameinteger": "1313200000",
"namerealnumber": "4324325000put",
"nameemail": "qa@colosaput.com",
"namelogin": "sampleput",
"valorreal": "32,142,424.00",
"valorinteger": "4,242,424",
"porcentagereal": "424.00 %",
"porcentageinteger": "424 %",
"observaciones": "ningunaput",
"grid": {
"1": {
"sample": "unoput",
"currency1": "133,000.00",
"percentage1": "424.00 %",
}
"""
And I request "cases/95124734553388becc0e332080057699/variable"
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"
18130826553359171798e40060879912
"nameany": "wendy344%",
"namealphabetic": "nestor123",
"namealphanumeric": "rad1233$%",
"nameinteger": "342432,7",
"namerealnumber": "35353",
"nameemail": "wendycolosacom",
"namelogin": "sample",
"valorreal": "242343253,253.00",
"valorinteger": "346436363",
"porcentagereal": "64600",
"porcentageinteger": "464",
"observaciones": "ninguna",
"areascolosa": "sample",
"areascolosa_label": "sample",
"COUNTRY": "BOA",
"COUNTRY_label": "Bolivia",
"STATE": "aH",
"STATE_label": "Chuquisaca",
"LOCATION": "SRE",
"LOCATION_label": "Sucre",
"aprobado": "20",
"aprobadohint": "0",
"checkbox1": "sample",
"checkbox2": "oki",
"checkbox3": "Off",
"radiogroup1": "hola",
"radiogroup1_label": "Primero",
"date1": "hola",
"date2": "2013-11-08",
"date3": "2014-03-09",
"date4": "2014-03-02",
"suggest2": "51049032352d56710347233042615067",
"suggest2_label": "sample",
"grid": {
"1": {
"sample": "hugo",
"currency1": "2,424,234.00",
"percentage1": "354.00 %",
"suggest1_label": "dorothy",
"suggest1": "81205219852d56719a97fc3086456770",
"textarea1": "ninguno",
"dropdown1": "uno",
"yesno1": "0",
"checkbox1": "On",
"date1": "2014-03-20",
"link1": "http://www.google.com/",
"link1_label": "link1",
"file1": "Tuesday.docx",
"dropdown1_label": "uno"

View File

@@ -9,7 +9,7 @@ Background:
Scenario: Returns a list of the uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
Given I request "cases/64654381053382b8bb4c415067063003/input-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
@@ -17,19 +17,19 @@ Scenario: Returns a list of the uploaded documents for a given case
Scenario: Returns an uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-document/6075490825331a1c5eebff9015468244"
Given I request "cases/64654381053382b8bb4c415067063003/input-document/6075490825331a1c5eebff9015468244"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Scenario: Post metadata and then upload documents for a given case
Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/3980158475331a1a0288fd3009853776/input-document"
Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/64654381053382b8bb4c415067063003/input-document"
"""
{
"inp_doc_uid": "inp_doc_uid",
"tas_uid": "tas_uid",
"inp_doc_uid": "68671480353319e5e1dee74089764900",
"tas_uid": "19582733053319e304cfa76025663570",
"app_doc_comment": "app_doc_comment"
@@ -44,7 +44,7 @@ Scenario: Post metadata and then upload documents for a given case
Scenario: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "" stored in session array
And I request "cases/3980158475331a1a0288fd3009853776/input-document/{app_doc_uid}"
And I request "cases/64654381053382b8bb4c415067063003/input-document/{app_doc_uid}"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"

View File

@@ -9,7 +9,7 @@ Background:
Scenario: Returns a list of the uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
Given I request "cases/64654381053382b8bb4c415067063003/input-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
@@ -17,7 +17,7 @@ Scenario: Returns a list of the uploaded documents for a given case
Scenario Outline: Returns an uploaded documents for a given case
Given I request "cases/3980158475331a1a0288fd3009853776/input-document/<input-document>"
Given I request "cases/64654381053382b8bb4c415067063003/input-document/<input-document>"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
@@ -38,4 +38,40 @@ Scenario Outline: Returns an uploaded documents for a given case
| Get Input "Screenshot Case Archive.docx" | 3770386635331a1f49c78e8070071944 | 3770386635331a1f49c78e8070071944 | Screenshot Case Archive.docx | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:34:12 | , Administrator (admin) | INPUT | 2 | cases/cases_ShowDocument?a=3770386635331a1f49c78e8070071944&v=1 |
| Get Input "alert_message.html" | 6382509235331a235b27a82003894796 | 6382509235331a235b27a82003894796 | alert_message.htm | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:17 | , Administrator (admin) | INPUT | 4 | cases/cases_ShowDocument?a=6382509235331a235b27a82003894796&v=1 |
| Get Input "actionsByEmail-2.5.0.28.tar" | 3548449385331a24a34d273018695729 | 3548449385331a24a34d273018695729 | actionsByEmail-2.5.0.28.tar | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:38 | , Administrator (admin) | INPUT | 5 | cases/cases_ShowDocument?a=3548449385331a24a34d273018695729&v=1 |
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |
Scenario Outline: Post metadata and then upload documents for a given case
Given POST upload an input document "<document_file>" to "cases/<case_uid>/input-document"
"""
{
"inp_doc_uid": "<inp_doc_uid>",
"tas_uid": "<tas_uid>",
"app_doc_comment": "<app_doc_comment>"
}
"""
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 "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 | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
Scenario Outline: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "app_doc_uid_<app_doc_uid_number>" stored in session array
And I request "cases/64654381053382b8bb4c415067063003/input-document/"
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:
| app_doc_uid_number |
| 1 |

View File

@@ -9,7 +9,7 @@ Background:
Scenario: Returns a list of the generated documents for a given cases
Given I request "cases/24438110553330068247694030259829/output-documents"
Given I request "cases/33125846153383cecdf64f1079330191/output-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
@@ -17,7 +17,7 @@ Scenario: Returns a list of the generated documents for a given cases
Scenario: Returns an generated document for a given case
Given I request "cases/24438110553330068247694030259829/output-document/3000248055333006ab56a01005891659"
Given I request "cases/33125846153383cecdf64f1079330191/output-document/3000248055333006ab56a01005891659"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "Object"
@@ -30,17 +30,18 @@ Scenario: Generate or regenerates an output documents for a given case
"out_doc_uid": "2087233055331ef4127d238097105696"
}
"""
And I request "case/24438110553330068247694030259829/output-document"
Then the response status code should be 201
And I request "cases/33125846153383cecdf64f1079330191/output-document"
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 store "app_doc_uid" in session array as variable "app_doc_uid_0"
Scenario: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "" stored in session array
And I request "output-document/{uid}"
And that I want to delete a resource with the key "app_doc_uid_0" stored in session array
Gie I request "output-document"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"

View File

@@ -15,7 +15,7 @@ Scenario Outline: Generate or regenerates an output documents for a given case
"out_doc_uid": "<out_doc_uid>"
}
"""
And I request "cases/551390121533343ee886813057396196/output-document"
And I request "cases/33125846153383cecdf64f1079330191/output-document"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
@@ -33,7 +33,7 @@ Scenario Outline: Generate or regenerates an output documents for a given case
Scenario: Returns a list of the generated documents for a given cases
Given I request "cases/551390121533343ee886813057396196/output-documents"
Given I request "cases/33125846153383cecdf64f1079330191/output-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
@@ -47,7 +47,7 @@ Scenario: Returns a list of the generated documents for a given cases
Scenario Outline: Returns an generated document for a given case
Given I request "cases/551390121533343ee886813057396196/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
Given I request "cases/33125846153383cecdf64f1079330191/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "Object"
@@ -76,7 +76,7 @@ Scenario Outline: Returns an generated document for a given case
Scenario Outline: Delete an uploaded or generated document from a case.
Given that I want to delete a resource with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
And I request "cases/551390121533343ee886813057396196/output-document"
And I request "cases/33125846153383cecdf64f1079330191/output-document"
And the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"

View File

@@ -1,4 +1,4 @@
@ProcessMakerMichelangelo @RestAPI
miche@ProcessMakerMichelangelo @RestAPI
Feature: ProcessPermissions Resources
@1: TEST FOR GET PROCESS PERMISSIONS /----------------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
FA<?php
<?php
use Behat\Behat\Context\BehatContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
@@ -339,6 +339,8 @@ class RestContext extends BehatContext
$this->_headers['Authorization'] = 'Bearer ' . $this->access_token;
}
if($urlType=="absolute"){
$this->_requestUrl = $pageUrl;
@@ -367,7 +369,7 @@ class RestContext extends BehatContext
case 'POST':
$postFields = is_object($this->_restObject)
? (array)$this->_restObject
: $this->_restObject;
: $this->_restObject;
$this->_request = $this->_client
->post($url, $this->_headers,
(empty($this->_requestBody) ? $postFields :
@@ -1481,43 +1483,15 @@ class RestContext extends BehatContext
*/
public function postUploadAnInputDocumentTo($file, $url, PyStringNode $string)
{
$baseUrl = $this->getParameter('base_url');
$url = $baseUrl.$url;
$accesstoken = $this->getParameter('access_token');
$headr = array();
$headr[] = 'Authorization: Bearer '.$accesstoken;
$postFields = json_decode($string);
$postFields->form ='@'.$file;
//print_r($postFields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
print_r($postResult);
curl_close($ch);
//Save result as usual
$this->_type = 'json';
//$this->_response = json_decode($postResult);
$this->_data = json_decode($postResult);
// $postResult = (array)json_decode($postResult);
$this->_restObjectMethod = 'post';
$this->_restObject = $postFields;
$this->iRequest($url);
}
}

View File

@@ -0,0 +1,19 @@
<?php
$accesstoken = "e79057f4276661bedb6154eed3834f6cbd738853";
$headr = array();
$inp_doc_uid = '68671480353319e5e1dee74089764900';
$tas_uid = '19582733053319e304cfa76025663570';
$app_doc_comment = 'desde script php';
$headr[] = 'Authorization: Bearer '.$accesstoken;
$file = "/home/wendy/uploadfiles/test1.html";
$url = "http://wendy.pmos.colosa.net/api/1.0/wendy/cases/64654381053382b8bb4c415067063003/input-document";
$ch = curl_init();
$a = array('form'=>'@'.$file, 'inp_doc_uid'=>$inp_doc_uid, 'tas_uid' =>$tas_uid, 'app_doc_comment' =>$app_doc_comment);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POSTFIELDS, $a);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
print_r($postResult);