19 require_once (
'../../../tests/fossologyTestCase.php');
20 require_once (
'../../../tests/TestEnvironment.php');
34 function testUploadFile()
38 print
"starting UploadFileTest\n";
40 $loggedIn = $this->mybrowser->get($URL);
41 $this->assertTrue($this->myassertText($loggedIn,
'/Upload/'));
42 $this->assertTrue($this->myassertText($loggedIn,
'/From File/'));
43 $page = $this->mybrowser->get(
"$URL?mod=upload_file");
45 $this->assertTrue($this->myassertText($page,
'/Upload a New File/'));
46 $this->assertTrue($this->myassertText($page,
'/Select the file to upload:/'));
47 $id = $this->
getFolderId(
'Basic-Testing', $page,
'folder');
48 $this->assertTrue($this->mybrowser->setField(
'folder', $id));
49 $this->assertTrue($this->mybrowser->setField(
'getfile',
'/home/fosstester/licenses/gpl-3.0.txt' ));
50 $desc =
'File gpl-3.0.txt uploaded by test UploadFileTest into Basic-Testing folder';
51 $this->assertTrue($this->mybrowser->setField(
'description',
"$desc" ));
53 $upload_name =
'TestUploadFile-' .
"$id";
54 $this->assertTrue($this->mybrowser->setField(
'name', $upload_name ));
56 $page = $this->mybrowser->clickSubmit(
'Upload');
58 $this->assertTrue($page);
59 $this->assertTrue($this->myassertText($page,
'/The file .*? has been uploaded/'),
60 "FAILURE:Did not find the message 'The file .*? has been uploaded'\n");
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)