Moved the access token creation files to authorization_code folder and keep two files as bak that it will be necessary review and look for the best way to test these in order to create CLIENT_ID and CLIENT_SECRET.

This commit is contained in:
veronicaaruquipa
2014-12-18 19:57:40 -04:00
parent 67671cff8a
commit 69cd88a6f4
4 changed files with 556 additions and 556 deletions

View File

@@ -1,160 +1,160 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Generate token Grant type - Authorization Code Feature: Generate token Grant type - Authorization Code
Requirements: Requirements:
a workspace with open session and installed application a workspace with open session and installed application
Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
Given OAUTH register an application Given OAUTH register an application
""" """
{ {
"name":"<application_name>", "name":"<application_name>",
"description":"<application_description>", "description":"<application_description>",
"webSite":"<application_website>", "webSite":"<application_website>",
"redirectUri":"<application_redirectUri>", "redirectUri":"<application_redirectUri>",
"applicationNumber":"<application_number>" "applicationNumber":"<application_number>"
} }
""" """
Examples: Examples:
| Description | application_number | application_name | application_description | application_website | application_redirectUri | | Description | application_number | application_name | application_description | application_website | application_redirectUri |
| Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | | Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant |
| Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | | Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant |
#Endpoint para verificar el correcto funcionamiento del token generado en este script #Endpoint para verificar el correcto funcionamiento del token generado en este script
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records
And the "out_doc_title" property in row 0 equals "<out_doc_title>" And the "out_doc_title" property in row 0 equals "<out_doc_title>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | | test_description | project | records | out_doc_title | application_number |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 |
Scenario Outline: Get the Output Documents List both process (without valid token) Scenario Outline: Get the Output Documents List both process (without valid token)
Given I request "project/<project>/output-documents" Given I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | | test_description | project | records | out_doc_title | application_number |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 |
#Endpoint para hacer que expire los token creados en este script #Endpoint para hacer que expire los token creados en este script
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 1 | 1 | | Expire token 1 | 1 |
| Expire token 2 | 2 | | Expire token 2 | 2 |
#Endpoint para verificar que el token haya expirado #Endpoint para verificar que el token haya expirado
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |
#Grant type Refresh Token #Grant type Refresh Token
Scenario Outline: Refresh token Scenario Outline: Refresh token
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request a refresh token for "refresh_token_<grant_number>" And I request a refresh token for "refresh_token_<grant_number>"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "object"
And store "access_token" in session array as variable "access_token_<refresh_token_number>" And store "access_token" in session array as variable "access_token_<refresh_token_number>"
And store "expires_in" in session array as variable "expires_in_<refresh_token_number>" And store "expires_in" in session array as variable "expires_in_<refresh_token_number>"
And store "token_type" in session array as variable "token_type_<refresh_token_number>" And store "token_type" in session array as variable "token_type_<refresh_token_number>"
And store "scope" in session array as variable "scope_<refresh_token_number>" And store "scope" in session array as variable "scope_<refresh_token_number>"
Examples: Examples:
| Description | grant_number | refresh_token_number | | Description | grant_number | refresh_token_number |
| Create token normal | 1 | 3 | | Create token normal | 1 | 3 |
| Create token normal | 2 | 4 | | Create token normal | 2 | 4 |
#Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script #Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records
And the "out_doc_title" property in row 0 equals "<out_doc_title>" And the "out_doc_title" property in row 0 equals "<out_doc_title>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | | test_description | project | records | out_doc_title | application_number |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 3 | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 3 |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 |
#Endpoint para borrar el token creado en este script #Endpoint para borrar el token creado en este script
Scenario Outline: Delete all tokens created previously in this script Scenario Outline: Delete all tokens created previously in this script
Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array
And I request "oauth2" And I request "oauth2"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
Examples: Examples:
| application_number | | application_number |
| 1 | | 1 |
| 2 | | 2 |
| 3 | | 3 |
| 4 | | 4 |
#Endpoint para verificar que el token ya no existe #Endpoint para verificar que el token ya no existe
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 3 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 3 | Unauthorized |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | Unauthorized |

View File

@@ -1,131 +1,131 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Generate token Grant type - Client Credentials Grant Feature: Generate token Grant type - Client Credentials Grant
Requirements: Requirements:
a workspace with installed application a workspace with installed application
Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
Given POST this data: Given POST this data:
""" """
{ {
"grant_type":"<grant_type>" "grant_type":"<grant_type>"
} }
""" """
And I request a client credential grant And I request a client credential grant
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "object"
And store "access_token" in session array as variable "access_token_<grant_number>" And store "access_token" in session array as variable "access_token_<grant_number>"
And store "expires_in" in session array as variable "expires_in_<grant_number>" And store "expires_in" in session array as variable "expires_in_<grant_number>"
And store "token_type" in session array as variable "token_type_<grant_number>" And store "token_type" in session array as variable "token_type_<grant_number>"
Examples: Examples:
| Description | grant_number | grant_type | | Description | grant_number | grant_type |
| Create token normal | 1 | client_credentials | | Create token normal | 1 | client_credentials |
| Create token normal | 2 | client_credentials | | Create token normal | 2 | client_credentials |
#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases
Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Scenario Outline: Returns a list of the cases for the logged in user (Inbox)
Given that I assign an access token from session variable "access_token_<grant_number>" Given that I assign an access token from session variable "access_token_<grant_number>"
And I request "cases" And I request "cases"
Then the response status code should be 400 Then the response status code should be 400
And the response charset is "UTF-8" And the response charset is "UTF-8"
Examples: Examples:
| Description | grant_number | | Description | grant_number |
| Create token normal | 1 | | Create token normal | 1 |
| Create token normal | 2 | | Create token normal | 2 |
#Endpoint para hacer que expire los token creados en este script #Endpoint para hacer que expire los token creados en este script
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 1 | 1 | | Expire token 1 | 1 |
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 2 | 2 | | Expire token 2 | 2 |
#Endpoint para verificar que el token haya expirado #Endpoint para verificar que el token haya expirado
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |
#Endpoint para borrar el token creado en este script #Endpoint para borrar el token creado en este script
Scenario Outline: Delete all tokens created previously in this script Scenario Outline: Delete all tokens created previously in this script
Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array
And I request "oauth2" And I request "oauth2"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
Examples: Examples:
| application_number | | application_number |
| 1 | | 1 |
| 2 | | 2 |
#Endpoint para verificar que el token ya no existe #Endpoint para verificar que el token ya no existe
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |

View File

@@ -1,126 +1,126 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Generate token Grant type - Implicit Grant Feature: Generate token Grant type - Implicit Grant
Requirements: Requirements:
a workspace with installed application a workspace with installed application
Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
Given OAUTH request implicit grant Given OAUTH request implicit grant
""" """
{ {
"response_type":"<response_type>", "response_type":"<response_type>",
"client_id":"<client_id>", "client_id":"<client_id>",
"scope":"<scope>", "scope":"<scope>",
"implicit_grant_number":"<implicit_grant_number>" "implicit_grant_number":"<implicit_grant_number>"
} }
""" """
Examples: Examples:
| Description | implicit_grant_number | response_type | client_id | scope | | Description | implicit_grant_number | response_type | client_id | scope |
| Create token normal | 1 | token | x-pm-local-client | * | | Create token normal | 1 | token | x-pm-local-client | * |
| Create token normal | 2 | token | x-pm-local-client | * | | Create token normal | 2 | token | x-pm-local-client | * |
#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases
Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Scenario Outline: Returns a list of the cases for the logged in user (Inbox)
Given that I assign an access token from session variable "access_token_<implicit_grant_number>" Given that I assign an access token from session variable "access_token_<implicit_grant_number>"
And I request "cases" And I request "cases"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 14 records And the response has 14 records
Examples: Examples:
| Description | implicit_grant_number | | Description | implicit_grant_number |
| Create token normal | 1 | | Create token normal | 1 |
| Create token normal | 2 | | Create token normal | 2 |
#Endpoint para hacer que expire los token creados en este script #Endpoint para hacer que expire los token creados en este script
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 1 | 1 | | Expire token 1 | 1 |
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 2 | 2 | | Expire token 2 | 2 |
#Endpoint para verificar que el token haya expirado #Endpoint para verificar que el token haya expirado
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |
#Endpoint para borrar el token creado en este script #Endpoint para borrar el token creado en este script
Scenario Outline: Delete all tokens created previously in this script Scenario Outline: Delete all tokens created previously in this script
Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array
And I request "oauth2" And I request "oauth2"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
Examples: Examples:
| application_number | | application_number |
| 1 | | 1 |
| 2 | | 2 |
#Endpoint para verificar que el token ya no existe #Endpoint para verificar que el token ya no existe
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |

View File

@@ -1,139 +1,139 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Generate token Grant type - Resources Owner Password Credential Grant Feature: Generate token Grant type - Resources Owner Password Credential Grant
Requirements: Requirements:
a workspace with installed application a workspace with installed application
Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
Given POST this data: Given POST this data:
""" """
{ {
"grant_type":"<grant_type>", "grant_type":"<grant_type>",
"username":"<username>", "username":"<username>",
"password":"<password>", "password":"<password>",
"scope":"<scope>" "scope":"<scope>"
} }
""" """
And I request a owner password credential grant And I request a owner password credential grant
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "object" And the type is "object"
And store "access_token" in session array as variable "access_token_<grant_number>" And store "access_token" in session array as variable "access_token_<grant_number>"
And store "expires_in" in session array as variable "expires_in_<grant_number>" And store "expires_in" in session array as variable "expires_in_<grant_number>"
And store "token_type" in session array as variable "token_type_<grant_number>" And store "token_type" in session array as variable "token_type_<grant_number>"
And store "scope" in session array as variable "scope_<grant_number>" And store "scope" in session array as variable "scope_<grant_number>"
And store "refresh_token" in session array as variable "refresh_token_<grant_number>" And store "refresh_token" in session array as variable "refresh_token_<grant_number>"
Examples: Examples:
| Description | grant_number | grant_type | username | password | scope | | Description | grant_number | grant_type | username | password | scope |
| Create token normal | 1 | password | amy | sample | * | | Create token normal | 1 | password | amy | sample | * |
| Create token normal | 2 | password | admin | sample123* | * | | Create token normal | 2 | password | admin | sample123* | * |
#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases #Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases
Scenario Outline: Returns a list of the cases for the logged in user (Inbox) Scenario Outline: Returns a list of the cases for the logged in user (Inbox)
Given that I assign an access token from session variable "access_token_<grant_number>" Given that I assign an access token from session variable "access_token_<grant_number>"
And I request "cases" And I request "cases"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has <records> records And the response has <records> records
Examples: Examples:
| Description | grant_number | records | | Description | grant_number | records |
| Create token normal | 1 | 4 | | Create token normal | 1 | 4 |
| Create token normal | 2 | 14 | | Create token normal | 2 | 14 |
#Endpoint para hacer que expire los token creados en este script #Endpoint para hacer que expire los token creados en este script
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 1 | 1 | | Expire token 1 | 1 |
Scenario Outline: Expire token created in this script Scenario Outline: Expire token created in this script
Given POST this data: Given POST this data:
""" """
{ {
} }
""" """
And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>" And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_<application_number>"
Then the response status code should be 200 Then the response status code should be 200
Examples: Examples:
| Description | application_number | | Description | application_number |
| Expire token 2 | 2 | | Expire token 2 | 2 |
#Endpoint para verificar que el token haya expirado #Endpoint para verificar que el token haya expirado
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |
#Endpoint para borrar el token creado en este script #Endpoint para borrar el token creado en este script
Scenario Outline: Delete all tokens created previously in this script Scenario Outline: Delete all tokens created previously in this script
Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array Given that I want to delete a resource with the key "access_token_<application_number>" stored in session array
And I request "oauth2" And I request "oauth2"
And the content type is "application/json" And the content type is "application/json"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
Examples: Examples:
| application_number | | application_number |
| 1 | | 1 |
| 2 | | 2 |
#Endpoint para verificar que el token ya no existe #Endpoint para verificar que el token ya no existe
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized |
Scenario Outline: Get the Output Documents List both process Scenario Outline: Get the Output Documents List both process
Given that I assign an access token from session variable "access_token_<application_number>" Given that I assign an access token from session variable "access_token_<application_number>"
And I request "project/<project>/output-documents" And I request "project/<project>/output-documents"
Then the response status code should be 401 Then the response status code should be 401
And the response status message should have the following text "<error_message>" And the response status message should have the following text "<error_message>"
Examples: Examples:
| test_description | project | records | out_doc_title | application_number | error_message | | test_description | project | records | out_doc_title | application_number | error_message |
| List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized |