30 require_once (
'../../../tests/fossologyTestCase.php');
31 require_once (
'../../../tests/TestEnvironment.php');
45 function testUploadFile()
49 print
"starting UploadFileTest\n";
51 $loggedIn = $this->mybrowser->get($URL);
52 $this->assertTrue($this->myassertText($loggedIn,
'/Upload/'));
53 $this->assertTrue($this->myassertText($loggedIn,
'/From File/'));
54 $page = $this->mybrowser->get(
"$URL?mod=upload_file");
56 $this->assertTrue($this->myassertText($page,
'/Upload a New File/'));
57 $this->assertTrue($this->myassertText($page,
'/Select the file to upload:/'));
58 $id = $this->
getFolderId(
'Basic-Testing', $page,
'folder');
59 $this->assertTrue($this->mybrowser->setField(
'folder', $id));
60 $this->assertTrue($this->mybrowser->setField(
'getfile',
'/home/fosstester/licenses/gpl-3.0.txt' ));
61 $desc =
'File gpl-3.0.txt uploaded by test UploadFileTest into Basic-Testing folder';
62 $this->assertTrue($this->mybrowser->setField(
'description',
"$desc" ));
64 $upload_name =
'TestUploadFile-' .
"$id";
65 $this->assertTrue($this->mybrowser->setField(
'name', $upload_name ));
67 $page = $this->mybrowser->clickSubmit(
'Upload');
69 $this->assertTrue($page);
70 $this->assertTrue($this->myassertText($page,
'/The file .*? has been uploaded/'),
71 "FAILURE:Did not find the message 'The file .*? has been uploaded'\n");
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)