16 require_once (
'../../../tests/fossologyTestCase.php');
17 require_once (
'../../../tests/TestEnvironment.php');
41 function testBrowseUploaded()
45 print
"starting BrowseUploadedtest\n";
46 $page = $this->mybrowser->get(
"$URL?mod=browse");
47 $this->assertTrue($this->myassertText($page,
'/Browse/'),
48 "BrowseUploadedTest FAILED! Could not find Browse menu\n");
49 $this->assertTrue($this->myassertText($page,
"/Browse/"),
50 "BrowseUploadedTest FAILED! Browse Title not found\n");
51 $this->assertTrue($this->myassertText($page,
"|simpletest_1\.0\.1\.tar\.gz|"),
52 "BrowseUploadedTest FAILED did not find string simpletest_1.0.1.tar.gz\n");
53 $this->assertTrue($this->myassertText($page,
"/>View</"),
54 "BrowseUploadedTest FAILED! Do not see >View< link\n");
55 $this->assertTrue($this->myassertText($page,
"/>Info</"),
56 "BrowseUploadedTest FAILED!FAIL!Do not see >Info< not found\n");
57 $this->assertTrue($this->myassertText($page,
"/>Download</"),
58 "BrowseUploadedTest FAILED!FAIL! Do not see >Download< not found\n");
61 $page = $this->mybrowser->clickLink(
'simpletest_1.0.1.tar.gz');
63 $this->assertTrue($this->myassertText($page,
"/simpletest\//"),
64 "BrowseUploadedTest FAILED! simpletest link not found\n)");
69 $this->assertFalse($this->myassertText($page,
"/>View</"),
70 "BrowseUploadedTest FAILED! Do not see >View< link\n");
71 $this->assertFalse($this->myassertText($page,
"/>Info</"),
72 "BrowseUploadedTest FAILED! Do not see >Info< link\n");
73 $this->assertFalse($this->myassertText($page,
"/>Download</"),
74 "BrowseUploadedTest FAILED! Do not see >Download< link\n");
78 $page = $this->mybrowser->clickLink(
'simpletest');
79 print
"*** Page after click simpletest\n$page\n";
80 $this->assertTrue($this->myassertText($page,
"/HELP_MY_TESTS_DONT_WORK_ANYMORE/"));
81 $this->assertTrue($this->myassertText($page,
"/$name/"),
82 "BrowseUploadedTest FAILED! did not find simpletest_1.0.1.tar.gz\n");
83 $this->assertTrue($this->myassertText($page,
"/>View</"),
84 "BrowseUploadedTest FAILED! Do not see >View< link\n");
85 $this->assertTrue($this->myassertText($page,
"/>Info</"),
86 "BrowseUploadedTest FAILED! Do not see >Info< link\n");
87 $this->assertTrue($this->myassertText($page,
"/>Download</"),
88 "BrowseUploadedTest FAILED! Do not see >Download< link\n");
91 $page = $this->mybrowser->clickLink(
'License');
92 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
93 "BrowseUploadedTest FAILED!FAIL! License Browser not found\n");
94 $this->assertTrue($this->myassertText($page,
'/Total licenses: 3/'),
95 "BrowseUploadedTest FAILED!FAIL! Total Licenses does not equal 3\n");
98 $showLink = $this->mybrowser->clickLink(
'Show');
100 $licLink = $this->mybrowser->clickLink(
'LICENSE');
101 $viewLink = $this->makeUrl($this->host, $licLink);
102 $page = $this->mybrowser->get($viewLink);
103 $this->assertTrue($this->myassertText($page,
'/View License/'),
104 "BrowseUploadedTest FAILED!FAIL! View License not found\n");
105 $licenseResult = $this->mybrowser->getContentAsText($viewLink);
106 $this->assertTrue($this->myassertText($licenseResult,
'/100% view LGPL v2\.1/'),
107 "BrowseUploadedTest FAILED!FAIL! Did not find '100% view LGPL v2.1'\n In the License Table for simpletest\n");
Login($User=NULL, $Password=NULL)