Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-940

This commit is contained in:
Luis Fernando Saisa Lopez
2015-01-15 15:25:03 -04:00
3 changed files with 111 additions and 41 deletions

View File

@@ -4,6 +4,9 @@ Feature: Project User Resources
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
# GET /api/1.0/{workspace}/project/<project-uid>/users
# Get project users list
Scenario: Get a list of users of a project Scenario: Get a list of users of a project
Given I request "project/1265557095225ff5c688f46031700471/users" Given I request "project/1265557095225ff5c688f46031700471/users"
Then the response status code should be 200 Then the response status code should be 200
@@ -11,40 +14,48 @@ Feature: Project User Resources
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
# GET /api/1.0/{workspace}/project/<project-uid>/starting-tasks
# Get started tasks list
Scenario: Get a list of starting task of a project Scenario: Get a list of starting task of a project
Given I request "project/1265557095225ff5c688f46031700471/starting-tasks" Given I request "project/1265557095225ff5c688f46031700471/starting-tasks"
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: Get a list of start task of a user
Given I request "project/1265557095225ff5c688f46031700471/user/00000000000000000000000000000001/starting-tasks"
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"
# GET /api/1.0/{workspace}/project/<project-uid>/user/<user-uid>/starting-tasks
# Get started tasks list by a user
Scenario: Get a list of start task of a user
Given I request "project/1265557095225ff5c688f46031700471/user/00000000000000000000000000000001/starting-tasks"
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"
# GET /api/1.0/{workspace}/project/<project-uid>/ws/user/can-start-task
# Verify if it is possible to start a task with valid/invalid credentials
Scenario Outline: Verify if a user can start a task Scenario Outline: Verify if a user can start a task
Given POST this data: Given POST this data:
""" """
{ {
"act_uid": "<act_uid>", "act_uid": "<act_uid>",
"username": "<username>", "username": "<username>",
"password": "<password>" "password": "<password>"
} }
""" """
And I request "project/1265557095225ff5c688f46031700471/ws/user/can-start-task" And I request "project/1265557095225ff5c688f46031700471/ws/user/can-start-task"
Then the response status code should be <http_code> Then the response status code should be <http_code>
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 "<type>" And the type is "<type>"
Examples: Examples:
| test_description | act_uid | username | password | http_code | type | | test_description | act_uid | username | password | http_code | type |
| error username | 1352844695225ff5fe54de2005407079 | adm | admin | 400 | string | | error username | 1352844695225ff5fe54de2005407079 | adm | admin | 400 | string |
# TODO review the Backend QA instance and Michelangelo instance (because a user with wrong password can able to start a task) | error password | 1352844695225ff5fe54de2005407079 | admin | adm | 400 | string |
#| error password | 1352844695225ff5fe54de2005407079 | admin | adm | 400 | string |
| short activity | 1352844695225ff5fe54de20 | admin | admin | 400 | string | | short activity | 1352844695225ff5fe54de20 | admin | admin | 400 | string |
| error activity | 225ff5fe54de20054070791352844695 | admin | admin | 400 | string | | error activity | 225ff5fe54de20054070791352844695 | admin | admin | 400 | string |
| all ok | 1352844695225ff5fe54de2005407079 | admin | sample123* | 200 | array | | all ok | 1352844695225ff5fe54de2005407079 | admin | sample123* | 200 | array |

View File

@@ -1,36 +1,38 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Project User Resources Negative Tests Feature: Project User Resources Negative Tests
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: Get a list of start task of a specific user
Given I request "project/1265557095225ff5c688f46031700471/user/23348978752d567259ea6f3004731611/starting-tasks" # GET /api/1.0/{workspace}/project/<project-uid>/user/<user-uid>/starting-tasks
# Get started tasks list by a user
Scenario: Get a list of start task of a specific user
Given I request "project/1265557095225ff5c688f46031700471/user/23348978752d567259ea6f3004731611/starting-tasks"
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"
And the content type is "application/json" And the content type is "application/json"
Scenario Outline: Verify if a user can start a task with bad parameters (negative tests) # POST /api/1.0/{workspace}/project/<project-uid>/ws/user/can-start-task
Given POST this data: # Start a task with bad credentials
""" Scenario Outline: Verify if a user can start a task with bad parameters (negative tests)
Given POST this data:
"""
{ {
"act_uid": "<act_uid>", "act_uid": "<act_uid>",
"username": "<username>", "username": "<username>",
"password": "<password>" "password": "<password>"
} }
""" """
And I request "project/<project>/ws/user/can-start-task" And I request "project/<project>/ws/user/can-start-task"
Then the response status code should be <error_code> Then the response status code should be <error_code>
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 | act_uid | username | password | error_code | error_message |
| test_description | project | act_uid | username | password | error_code | error_message | | Invalid act_uid | 1265557095225ff5c688f46031700471 | 00000000009999f5fe54de2005407079 | admin | sample123* | 400 | act_uid |
| Invalid act_uid | 1265557095225ff5c688f46031700471 | 00000000009999f5fe54de2005407079 | admin | sample123* | 400 | act_uid | | Invalid username | 1265557095225ff5c688f46031700471 | 1546168275225ff617b6a34046164891 | ain | admin | 400 | User not registered! |
| Invalid username | 1265557095225ff5c688f46031700471 | 1546168275225ff617b6a34046164891 | ain | admin | 400 | usr_uid | | Invalid password | 1265557095225ff5c688f46031700471 | 1546168275225ff617b6a34046164891 | erick | sle | 400 | Wrong password |
| Invalid password | 1265557095225ff5c688f46031700471 | 1546168275225ff617b6a34046164891 | erick | sle | 400 | usr_uid | | Field requered project | | 46941969352af5be2ab3f39001216717 | admin | admin | 400 | prj_uid |
| Field requered project | | 46941969352af5be2ab3f39001216717 | admin | admin | 400 | prj_uid | | Field requered act_uid | 1265557095225ff5c688f46031700471 | | admin | admin | 400 | act_uid |
| Field requered act_uid | 1265557095225ff5c688f46031700471 | | admin | admin | 400 | act_uid |

View File

@@ -5,6 +5,8 @@
var processesGrid; var processesGrid;
var store; var store;
var comboCategory; var comboCategory;
var winDesigner;
/** /**
* Global variables and variable initialization for import process. * Global variables and variable initialization for import process.
@@ -572,7 +574,18 @@ function saveProcess()
if (projectType == 'classicProject') { if (projectType == 'classicProject') {
location.href = 'processes_Map?PRO_UID='+resp.result.PRO_UID; location.href = 'processes_Map?PRO_UID='+resp.result.PRO_UID;
} else { } else {
location.href = '../designer?prj_uid='+resp.result.PRO_UID; if ( navigator.userAgent.indexOf('MSIE') !=-1 ) {
if ( typeof(winDesigner) == "undefined" || winDesigner.closed ){
winDesigner = window.open(
"../designer?prj_uid="+resp.result.PRO_UID,
'_blank'
);
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
}
} else {
location.href = '../designer?prj_uid='+resp.result.PRO_UID;
}
} }
}, },
failure: function(obj, resp) { failure: function(obj, resp) {
@@ -622,7 +635,18 @@ editProcess = function(typeParam)
url = 'processes_Map?PRO_UID=' + pro_uid; url = 'processes_Map?PRO_UID=' + pro_uid;
} }
location.href = url; if ( (navigator.userAgent.indexOf('MSIE') !=-1) && (type == "bpmn") ) {
if (typeof(winDesigner) == "undefined" || winDesigner.closed){
winDesigner = window.open(
url,
'_blank'
);
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
}
} else {
location.href = url;
}
} }
editNewProcess = function(){ editNewProcess = function(){
@@ -927,7 +951,18 @@ importProcessExistGroup = function()
var sNewProUid = resp_.sNewProUid; var sNewProUid = resp_.sNewProUid;
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") { if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
window.location.href = "../designer?prj_uid=" + sNewProUid; if ( navigator.userAgent.indexOf('MSIE') !=-1 ) {
if (typeof(winDesigner) == "undefined" || winDesigner.closed){
winDesigner = window.open(
"../designer?prj_uid=" + sNewProUid,
'_blank'
);
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
}
} else {
window.location.href = "../designer?prj_uid=" + sNewProUid;
}
} else { } else {
window.location.href = "processes_Map?PRO_UID=" + sNewProUid; window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
} }
@@ -1062,7 +1097,18 @@ importProcessExistProcess = function()
if (resp_.ExistGroupsInDatabase == 0) { if (resp_.ExistGroupsInDatabase == 0) {
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") { if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
window.location.href = "../designer?prj_uid=" + sNewProUid; if ( navigator.userAgent.indexOf('MSIE') !=-1 ) {
if (typeof(winDesigner) == "undefined" || winDesigner.closed){
winDesigner = window.open(
"../designer?prj_uid=" + sNewProUid,
'_blank'
);
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
}
} else {
window.location.href = "../designer?prj_uid=" + sNewProUid;
}
} else { } else {
window.location.href = "processes_Map?PRO_UID=" + sNewProUid; window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
} }
@@ -1189,7 +1235,18 @@ importProcess = function()
var sNewProUid = resp_.sNewProUid; var sNewProUid = resp_.sNewProUid;
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") { if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
window.location.href = "../designer?prj_uid=" + sNewProUid; if ( navigator.userAgent.indexOf('MSIE') !=-1 ) {
if (typeof(winDesigner) == "undefined" || winDesigner.closed){
winDesigner = window.open(
"../designer?prj_uid=" + sNewProUid,
'_blank'
);
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
}
} else {
window.location.href = "../designer?prj_uid=" + sNewProUid;
}
} else { } else {
window.location.href = "processes_Map?PRO_UID=" + sNewProUid; window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
} }