29 require_once (
'../../../tests/fossologyTestCase.php');
30 require_once (
'../../../tests/TestEnvironment.php');
44 function testUploadFile()
48 print
"starting DupUploadTest\n";
50 for ($i = 0; $i < 2; $i++)
52 $loggedIn = $this->mybrowser->get($URL);
53 $this->assertTrue($this->myassertText($loggedIn,
'/Upload/'));
54 $this->assertTrue($this->myassertText($loggedIn,
'/From File/'));
56 $page = $this->mybrowser->clickLink(
'From File');
57 $this->assertTrue($this->myassertText($page,
'/Upload a New File/'));
58 $this->assertTrue($this->myassertText($page,
'/Select the file to upload:/'));
61 $id = $this->
getFolderId(
'Basic-Testing', $page,
'folder');
62 $this->assertTrue($this->mybrowser->setField(
'folder', $id));
63 $this->assertTrue($this->mybrowser->setField(
'getfile',
'/home/fosstester/licenses/Affero-v1.0'));
64 $desc =
'File Affero-v1.0 uploaded by test UploadFileTest into Testing folder';
65 $this->assertTrue($this->mybrowser->setField(
'description',
"$desc"));
67 $upload_name =
'TestUploadFile-' .
"$id";
68 $this->assertTrue($this->mybrowser->setField(
'name', $upload_name));
70 $page = $this->mybrowser->clickSubmit(
'Upload');
71 $this->assertTrue($page);
74 $this->assertTrue($this->myassertText($page,
"/The file $upload_name has been uploaded/"),
75 "FAIL! A Duplicate Upload was NOT created!\n" .
76 "The phrase, The file $upload_name has been uploaded was NOT seen\n");
79 $this->assertFalse($this->myassertText($page,
"/Upload failed/"),
80 "FAIL! Upload Failed?\nPhrase 'Upload failed found\n");
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)