Arreglos en los features file manager, project resources, y modificacion de la funcion de upload en RestContext, y cambio del directorio de archivos externos
This commit is contained in:
@@ -201,6 +201,7 @@ Scenario Outline: Delete file
|
||||
| delete mailtemplates subfolder | 4 |
|
||||
| delete mailtemplates subfolder | 5 |
|
||||
| delete mailtemplates subfolder | 6 |
|
||||
| delete | 7 |
|
||||
|
||||
|
||||
Scenario Outline: Delete folder
|
||||
@@ -218,10 +219,11 @@ Scenario Outline: Delete folder
|
||||
#BUG 15207, The "Upload" accepts files with other extensions
|
||||
|
||||
Scenario Outline: Upload files with incorret extension ".exe" - "Project - Process Complete BPMN"
|
||||
Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1455892245368ebeb11c1a5001393784/file-manager"
|
||||
And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
|
||||
Given POST I want to upload the file "<file>" to path "<prf_path>". Url "project/1265557095225ff5c688f46031700471/file-manager"
|
||||
#And store "prf_uid" in session array as variable "prf_uid_<prf_number>"
|
||||
And the response status message should have the following text "incorrect extension"
|
||||
|
||||
Examples:
|
||||
| file | prf_path | prf_number |
|
||||
| SnagIt823.exe | templates | 1 |
|
||||
| file | prf_path | prf_number |
|
||||
| filemanager.exe | templates | 1 |
|
||||
|
||||
|
||||
@@ -773,7 +773,18 @@ Scenario Outline: Import a process - Test process NEW
|
||||
|
||||
|
||||
|
||||
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 "prj_uid" stored in session array as variable "prj_uid_<prj_uid_number>"
|
||||
And I request "projects"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| prj_uid_number |
|
||||
| 7 |
|
||||
|
||||
|
||||
|
||||
@@ -804,8 +815,7 @@ Scenario Outline: Delete a Project activity created previously in this script
|
||||
| 4 |
|
||||
| 5 |
|
||||
| 6 |
|
||||
| 7 |
|
||||
|
||||
|
||||
|
||||
Scenario: Get a list of projects
|
||||
Given I request "project"
|
||||
|
||||
@@ -80,8 +80,10 @@ class RestContext extends BehatContext
|
||||
$parameters = $this->_parameters;
|
||||
|
||||
if(($name=="uploadFilesFolder")&&(!isset($parameters[$name]) ) ){
|
||||
$parameters[$name] = "/opt/uploadfiles/";
|
||||
$defaultUploadPath = __DIR__ . "/../resources/uploadfiles/";
|
||||
$parameters[$name] = $defaultUploadPath;
|
||||
}
|
||||
$this->printDebug("Parameter: $name = ".$parameters[$name]);
|
||||
return (isset($parameters[$name])) ? $parameters[$name] : null;
|
||||
}
|
||||
}
|
||||
@@ -1397,57 +1399,36 @@ class RestContext extends BehatContext
|
||||
public function postIWantToUploadTheFileToPathPublicUrl($prfFile, $prfPath, $url)
|
||||
{
|
||||
$prfFile = $this->getParameter('uploadFilesFolder') . $prfFile;
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$url = $baseUrl.$url;
|
||||
$accesstoken = $this->getParameter('access_token');
|
||||
$headr = array();
|
||||
$headr[] = 'Authorization: Bearer '.$accesstoken;
|
||||
$path = rtrim($prfPath, '/') . '/';
|
||||
$sfile = end(explode("/",$prfFile));
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_filename'=>$sfile, "prf_path" => $path));
|
||||
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);
|
||||
|
||||
$postFields = array('prf_filename'=>$sfile, "prf_path" => $path);
|
||||
|
||||
curl_close($ch);
|
||||
$this->_restObjectMethod = 'post';
|
||||
$this->_restObject = $postFields;
|
||||
$this->iRequest($url);
|
||||
|
||||
$postResult = json_decode($this->_response->getBody(true));
|
||||
|
||||
|
||||
if(!isset($postResult->error)){
|
||||
|
||||
|
||||
$prfUid = $postResult->prf_uid;
|
||||
$url = $this->getParameter('base_url').$url.'/'.$prfUid."/upload";
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_file'=>'@'.$prfFile));
|
||||
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);
|
||||
}
|
||||
|
||||
//Save result as usual
|
||||
$this->_type = 'json';
|
||||
$this->_data = json_decode($postResult);
|
||||
|
||||
$postResult = (array)json_decode($postResult);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (sizeof($postResult) > 2) {
|
||||
$prfUid = $postResult["prf_uid"];
|
||||
} else {
|
||||
throw new Exception($postResult["error"]->message);
|
||||
//var_dump($postResult["error"]);
|
||||
}
|
||||
$url = $url.'/'.$prfUid."/upload";
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_file'=>'@'.$prfFile));
|
||||
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);
|
||||
|
||||
//se guarda el prf_uid en una variable
|
||||
|
||||
//Wen: Esto borra todo el session data, por favor corregir o no guardar la variable desde aca
|
||||
|
||||
//$varName = 'prf_uid';
|
||||
//$sessionData = new StdClass();
|
||||
//$sessionData->$varName = $prfUid;
|
||||
//file_put_contents("session.data", json_encode($sessionData));
|
||||
}
|
||||
|
||||
//UPLOAD IMAGE
|
||||
@@ -1578,7 +1559,6 @@ class RestContext extends BehatContext
|
||||
$this->_restObjectMethod = 'post';
|
||||
$this->_restObject = $postFields;
|
||||
$this->iRequest($url);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
6140
features/resources/uploadfiles/ExpBehat_Process_Complete_BPMN.pmx
Normal file
6140
features/resources/uploadfiles/ExpBehat_Process_Complete_BPMN.pmx
Normal file
File diff suppressed because one or more lines are too long
185
features/resources/uploadfiles/Export_process_empty.pmx
Normal file
185
features/resources/uploadfiles/Export_process_empty.pmx
Normal file
File diff suppressed because one or more lines are too long
8693
features/resources/uploadfiles/Process_Complete_BPMN.pmx
Normal file
8693
features/resources/uploadfiles/Process_Complete_BPMN.pmx
Normal file
File diff suppressed because one or more lines are too long
1401
features/resources/uploadfiles/Process_NewCreate_BPMN.pmx
Normal file
1401
features/resources/uploadfiles/Process_NewCreate_BPMN.pmx
Normal file
File diff suppressed because one or more lines are too long
BIN
features/resources/uploadfiles/SnagIt823.exe
Normal file
BIN
features/resources/uploadfiles/SnagIt823.exe
Normal file
Binary file not shown.
1
features/resources/uploadfiles/TestQA.html
Normal file
1
features/resources/uploadfiles/TestQA.html
Normal file
@@ -0,0 +1 @@
|
||||
Test QA - cuando se realiza la sobreescritura desde upload
|
||||
418
features/resources/uploadfiles/Test_Event_without_name.pmx
Normal file
418
features/resources/uploadfiles/Test_Event_without_name.pmx
Normal file
File diff suppressed because it is too large
Load Diff
1192
features/resources/uploadfiles/Test_process_NEW.pmx.pmx
Normal file
1192
features/resources/uploadfiles/Test_process_NEW.pmx.pmx
Normal file
File diff suppressed because it is too large
Load Diff
5
features/resources/uploadfiles/Unnamed_Array.pmx
Normal file
5
features/resources/uploadfiles/Unnamed_Array.pmx
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
16
features/resources/uploadfiles/alert_message.html
Normal file
16
features/resources/uploadfiles/alert_message.html
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody>
|
||||
<tr><td style='font-size: 14px;'><b>ALERT MESSAGE</b></td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<hr>
|
||||
<br />
|
||||
The Case <b>@#APP_NUMBER</b>, currently in the task <b>@#TAS_TITLE</b>, expired on <b>@#DEL_TASK_DUE_DATE</b>.
|
||||
<br />
|
||||
<br />
|
||||
<hr><b>This Business Process is powered by ProcessMaker.<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a>
|
||||
<br />
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
80
features/resources/uploadfiles/dynaform1.xml
Normal file
80
features/resources/uploadfiles/dynaform1.xml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm type="xmlform" name="1455892245368ebeb11c1a5001393784/898822326536be3a12addb0034537553" width="500" enabletemplate="0" mode="edit" nextstepsave="" printdynaform="1">
|
||||
<TITULO type="title" enablehtml="0" btn_cancel="Cancel" required="0" readonly="0" savelabel="0">
|
||||
<en>Test Funcionalidad - Dynaform</en>
|
||||
</TITULO>
|
||||
<Subtitulo type="subtitle" enablehtml="0" btn_cancel="Cancel" required="0" readonly="0" savelabel="0">
|
||||
<en>Texto</en>
|
||||
</Subtitulo>
|
||||
<Nombre type="text" maxlength="64" validate="Alpha" required="1" readonly="0" size="15" mode="edit" btn_cancel="Cancel" mask="" strto="UPPER" dependentfields="" defaultvalue="" hint="Fill this field with your name." formula="" function="" sqlconnection="" savelabel="0">
|
||||
<en>Alphabetic-UPPER</en>
|
||||
</Nombre>
|
||||
<Integer type="text" maxlength="64" validate="Int" required="1" readonly="0" size="15" mode="edit" btn_cancel="Cancel">
|
||||
<en>Integer</en>
|
||||
</Integer>
|
||||
<Email type="text" maxlength="64" validate="Email" strto="LOWER" required="1" readonly="0" size="15" mode="edit" btn_cancel="Cancel">
|
||||
<en>Email-lower</en>
|
||||
</Email>
|
||||
<Currency type="currency" maxlength="15" currency="$" validate="Real" mask="###,###,###,###.## $" required="1" readonly="0" size="15" mode="edit" btn_cancel="Cancel" defaultvalue="" hint="" formula="" function="" sqlconnection="" savelabel="0"> <en>Currency-Real </en>
|
||||
</Currency>
|
||||
<Password type="password" maxlength="15" required="1" autocomplete="0" readonly="0" size="15" mode="edit" btn_cancel="Cancel">
|
||||
<en>Password</en>
|
||||
</Password>
|
||||
<Suggest type="suggest" required="1" savelabel="1" size="15" mode="edit" sqlconnection="" maxresults="6" shownoresults="0" store_new_entry="0" table="" primary_key_type="0" btn_cancel="Cancel" defaultvalue="" hint="Fill in with a user name." primary_key="" table_data="" primary_key_data="" primary_key_type_data="" field="" readonly="0"><![CDATA[SELECT USR_UID, USR_USERNAME, CONCAT(USR_FIRSTNAME, " ", USR_LASTNAME) FROM USERS ]]><en>Suggest</en></Suggest>
|
||||
<Text_area type="textarea" required="1" readonly="0" rows="2" cols="32" mode="edit" btn_cancel="Cancel">
|
||||
<en>Text-Area</en>
|
||||
</Text_area>
|
||||
<Subtitulo2 type="subtitle" enablehtml="0" btn_cancel="Cancel" required="0" readonly="0" savelabel="0">
|
||||
<en><![CDATA[Multi-Selección]]></en>
|
||||
</Subtitulo2>
|
||||
<Dropdown type="dropdown" required="1" readonly="0" savelabel="0" mode="edit" options="Array" btn_cancel="Cancel" dependentfields="" defaultvalue="" hint="" sqlconnection="">
|
||||
<en>Dropdown <option name="Grids">Grids</option><option name="Input-Document">Input-Document</option><option name="Output-Document">Output-Document</option><option name="Triggers">Triggers</option></en>
|
||||
</Dropdown>
|
||||
<ListBox type="listbox" required="1" size="4" mode="edit" options="Array" btn_cancel="Cancel">
|
||||
<en>List-Box <option name="Box1">Box1</option>
|
||||
<option name="Box2">Box2</option>
|
||||
<option name="Box3">Box3</option>
|
||||
</en>
|
||||
</ListBox>
|
||||
<Checkbox type="checkbox" value="On" falsevalue="Off" required="1" defaultvalue="Off" readonly="0" labelonright="0" enablehtml="0" btn_cancel="Cancel">
|
||||
<en>Check-Box</en>
|
||||
</Checkbox>
|
||||
<Checkgroup type="checkgroup" mode="edit" options="Array" btn_cancel="Cancel" required="1">
|
||||
<en>Check-group <option name="Check1">Check1</option>
|
||||
<option name="Check2">Check2</option>
|
||||
<option name="Check3">Check3</option>
|
||||
</en>
|
||||
</Checkgroup>
|
||||
<RadioGroup type="radiogroup" required="1" mode="edit" options="Array" btn_cancel="Cancel">
|
||||
<en>Radio-Group <option name="Radio1">Radio1</option>
|
||||
<option name="Radio2">Radio2</option>
|
||||
<option name="Radio3">Radio3</option>
|
||||
</en>
|
||||
</RadioGroup>
|
||||
<Fecha type="date" relativedate="1" beforedate="0m" afterdate="1y" mask="%Y-%m-%d" editable="0" required="1" readonly="0" showtime="0" defaultvalue_sel="today" mode="edit" btn_cancel="Cancel" startdate="" enddate="" defaultvalue="today" hint="" savelabel="0">
|
||||
<en>Fecha</en>
|
||||
</Fecha>
|
||||
<Hidden type="hidden" defaultvalue="Hidden" mode="edit" btn_cancel="Cancel"/>
|
||||
<Link type="link" target_sel="_blank" target="_blank" value="ProcessMaker" btn_cancel="Cancel" link="http://www.processmaker.com" hint="" required="0" readonly="0" savelabel="0">
|
||||
<en>Link</en>
|
||||
</Link>
|
||||
<AddFile type="file" required="0" btn_cancel="Cancel">
|
||||
<en>Add-File</en>
|
||||
</AddFile>
|
||||
<Javascript type="javascript"><![CDATA[alert("Prueba JS");]]></Javascript>
|
||||
<Subtitulo3 type="subtitle" enablehtml="0" btn_cancel="Cancel">
|
||||
<en>Botones</en>
|
||||
</Subtitulo3>
|
||||
<YesNo type="yesno" readonly="0" mode="edit" btn_cancel="Cancel" required="0" defaultvalue="" hint="Oculta el botón (Conditions editor)" savelabel="0">
|
||||
<en>Yes-No</en>
|
||||
</YesNo>
|
||||
<Boton type="button" btn_cancel="Cancel">
|
||||
<en><![CDATA[Botón]]></en>
|
||||
</Boton>
|
||||
<Submit type="submit" btn_cancel="Cancel">
|
||||
<en>Submit</en>
|
||||
</Submit>
|
||||
<Reset type="reset" btn_cancel="Cancel">
|
||||
<en>Reset</en>
|
||||
</Reset>
|
||||
</dynaForm>
|
||||
1
features/resources/uploadfiles/filemanager.exe
Normal file
1
features/resources/uploadfiles/filemanager.exe
Normal file
@@ -0,0 +1 @@
|
||||
fvfvffv
|
||||
BIN
features/resources/uploadfiles/photo/pic1.jpg
Normal file
BIN
features/resources/uploadfiles/photo/pic1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
features/resources/uploadfiles/photo/pic2.jpg
Normal file
BIN
features/resources/uploadfiles/photo/pic2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
features/resources/uploadfiles/photo/pic3.jpg
Normal file
BIN
features/resources/uploadfiles/photo/pic3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
features/resources/uploadfiles/random.jpg
Normal file
BIN
features/resources/uploadfiles/random.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
18
features/resources/uploadfiles/test.pm
Normal file
18
features/resources/uploadfiles/test.pm
Normal file
File diff suppressed because one or more lines are too long
1
features/resources/uploadfiles/test.txt
Normal file
1
features/resources/uploadfiles/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
BEHAT TEST
|
||||
2
features/resources/uploadfiles/test1.html
Normal file
2
features/resources/uploadfiles/test1.html
Normal file
@@ -0,0 +1,2 @@
|
||||
hello world!
|
||||
test file!
|
||||
2
features/resources/uploadfiles/test2.html
Normal file
2
features/resources/uploadfiles/test2.html
Normal file
@@ -0,0 +1,2 @@
|
||||
hello world!
|
||||
test file!
|
||||
Reference in New Issue
Block a user