diff --git a/features/backend/projects/files_manager/main_test_files_manager.feature b/features/backend/projects/files_manager/main_test_files_manager.feature index b841470d6..b89488189 100644 --- a/features/backend/projects/files_manager/main_test_files_manager.feature +++ b/features/backend/projects/files_manager/main_test_files_manager.feature @@ -217,7 +217,7 @@ Scenario Outline: Delete folder #BUG 15207, The "Upload" accepts files with other extensions -Scenario Outline: Upload files to same folders "Project - Process Complete BPMN" +Scenario Outline: Upload files with incorret extension ".exe" - "Project - Process Complete BPMN" Given POST I want to upload the file "" to path "". Url "project/1455892245368ebeb11c1a5001393784/file-manager" And store "prf_uid" in session array as variable "prf_uid_" And the response status message should have the following text "incorrect extension" diff --git a/features/backend/projects/project/main_tests_project_resources.feature b/features/backend/projects/project/main_tests_project_resources.feature index 12dc1ee7f..727d86fca 100644 --- a/features/backend/projects/project/main_tests_project_resources.feature +++ b/features/backend/projects/project/main_tests_project_resources.feature @@ -720,8 +720,7 @@ Scenario Outline: Get definition of a project And the type is "object" And that "prj_name" is set to "Update Evaluation" And that "prj_description" is set to "Update" - And that "par_name" property in object "participants" equals "abcd" - + Examples: @@ -731,14 +730,18 @@ Scenario Outline: Get definition of a project #Test of successful export and import of objects "Data Object, Data Store, Black Box and Text" -Scenario: Get for Export Project - Test process NEW - Given that I want to get a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 - And I request "project//export" +Scenario Outline: Get for Export Project - Test process NEW + Given I request "project/new_uid/export" with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 Then the response status code should be 200 And the response charset is "UTF-8" And the content type is "application/xml" And save exported process to "/" as "Test process NEW.pmx" + Examples: + + | project_new_uid_number | + | 7 | + Scenario Outline: Delete a Project activity created previously in this script - Test process NEW Given that I want to delete a resource with the key "new_uid" stored in session array as variable "project_new_uid_" in position 0 @@ -765,7 +768,7 @@ Scenario Outline: Import a process - Test process NEW Examples: | project_file | import_option | prj_uid_number | - | Process_NewCreate_BPMN.pmx | create | 7 | + | Process_NewCreate_BPMN.pmx | CREATE | 7 | diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 1edb13fce..6601fd2d7 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1311,6 +1311,36 @@ class RestContext extends BehatContext } + /** + * @Given /^I request "([^"]*)" with the key "([^"]*)" stored in session array as variable "([^"]*)" in position (\d+)$/ + */ + public function iRequestWithTheKeyStoredInSessionArrayAsVariableInPosition($pageUrl, $varName, $sessionVarName, $position) + { + if (file_exists("session.data")) { + $sessionData = json_decode(file_get_contents("session.data")); + } else { + $sessionData = array(); + } + if (!isset($sessionData->$sessionVarName) ) { + $varValue = ''; + } else { + foreach ($sessionData->$sessionVarName as $key => $value) { + if($key == $position){ + $varValue = $value; + } + } + } + + $pageUrl = str_replace($varName, $varValue, $pageUrl); + + + $this->printDebug("URL: $pageUrl\n$varName = $varValue\nsessionVarName = $sessionVarName\n"); + + + $this->iRequest($pageUrl); + } + + /** * @Given /^the property "([^"]*)" of "([^"]*)" is set to "([^"]*)"$/ */