18 require_once (
'../../../tests/fossologyTestCase.php');
19 require_once (
'../../../tests/TestEnvironment.php');
33 function testUploadFile()
37 print
"starting DupUploadTest\n";
39 for ($i = 0; $i < 2; $i++)
41 $loggedIn = $this->mybrowser->get($URL);
42 $this->assertTrue($this->myassertText($loggedIn,
'/Upload/'));
43 $this->assertTrue($this->myassertText($loggedIn,
'/From File/'));
45 $page = $this->mybrowser->clickLink(
'From File');
46 $this->assertTrue($this->myassertText($page,
'/Upload a New File/'));
47 $this->assertTrue($this->myassertText($page,
'/Select the file to upload:/'));
50 $id = $this->
getFolderId(
'Basic-Testing', $page,
'folder');
51 $this->assertTrue($this->mybrowser->setField(
'folder', $id));
52 $this->assertTrue($this->mybrowser->setField(
'getfile',
'/home/fosstester/licenses/Affero-v1.0'));
53 $desc =
'File Affero-v1.0 uploaded by test UploadFileTest into Testing folder';
54 $this->assertTrue($this->mybrowser->setField(
'description',
"$desc"));
56 $upload_name =
'TestUploadFile-' .
"$id";
57 $this->assertTrue($this->mybrowser->setField(
'name', $upload_name));
59 $page = $this->mybrowser->clickSubmit(
'Upload');
60 $this->assertTrue($page);
63 $this->assertTrue($this->myassertText($page,
"/The file $upload_name has been uploaded/"),
64 "FAIL! A Duplicate Upload was NOT created!\n" .
65 "The phrase, The file $upload_name has been uploaded was NOT seen\n");
68 $this->assertFalse($this->myassertText($page,
"/Upload failed/"),
69 "FAIL! Upload Failed?\nPhrase 'Upload failed found\n");
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)