27 require_once (
'../../../tests/fossologyTestCase.php');
28 require_once (
'../../../tests/TestEnvironment.php');
52 function testBrowseUploaded()
56 print
"starting BrowseUploadedtest\n";
57 $page = $this->mybrowser->get(
"$URL?mod=browse");
58 $this->assertTrue($this->myassertText($page,
'/Browse/'),
59 "BrowseUploadedTest FAILED! Could not find Browse menu\n");
60 $this->assertTrue($this->myassertText($page,
"/Browse/"),
61 "BrowseUploadedTest FAILED! Browse Title not found\n");
62 $this->assertTrue($this->myassertText($page,
"|simpletest_1\.0\.1\.tar\.gz|"),
63 "BrowseUploadedTest FAILED did not find string simpletest_1.0.1.tar.gz\n");
64 $this->assertTrue($this->myassertText($page,
"/>View</"),
65 "BrowseUploadedTest FAILED! Do not see >View< link\n");
66 $this->assertTrue($this->myassertText($page,
"/>Info</"),
67 "BrowseUploadedTest FAILED!FAIL!Do not see >Info< not found\n");
68 $this->assertTrue($this->myassertText($page,
"/>Download</"),
69 "BrowseUploadedTest FAILED!FAIL! Do not see >Download< not found\n");
72 $page = $this->mybrowser->clickLink(
'simpletest_1.0.1.tar.gz');
74 $this->assertTrue($this->myassertText($page,
"/simpletest\//"),
75 "BrowseUploadedTest FAILED! simpletest link not found\n)");
80 $this->assertFalse($this->myassertText($page,
"/>View</"),
81 "BrowseUploadedTest FAILED! Do not see >View< link\n");
82 $this->assertFalse($this->myassertText($page,
"/>Info</"),
83 "BrowseUploadedTest FAILED! Do not see >Info< link\n");
84 $this->assertFalse($this->myassertText($page,
"/>Download</"),
85 "BrowseUploadedTest FAILED! Do not see >Download< link\n");
89 $page = $this->mybrowser->clickLink(
'simpletest');
90 print
"*** Page after click simpletest\n$page\n";
91 $this->assertTrue($this->myassertText($page,
"/HELP_MY_TESTS_DONT_WORK_ANYMORE/"));
92 $this->assertTrue($this->myassertText($page,
"/$name/"),
93 "BrowseUploadedTest FAILED! did not find simpletest_1.0.1.tar.gz\n");
94 $this->assertTrue($this->myassertText($page,
"/>View</"),
95 "BrowseUploadedTest FAILED! Do not see >View< link\n");
96 $this->assertTrue($this->myassertText($page,
"/>Info</"),
97 "BrowseUploadedTest FAILED! Do not see >Info< link\n");
98 $this->assertTrue($this->myassertText($page,
"/>Download</"),
99 "BrowseUploadedTest FAILED! Do not see >Download< link\n");
102 $page = $this->mybrowser->clickLink(
'License');
103 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
104 "BrowseUploadedTest FAILED!FAIL! License Browser not found\n");
105 $this->assertTrue($this->myassertText($page,
'/Total licenses: 3/'),
106 "BrowseUploadedTest FAILED!FAIL! Total Licenses does not equal 3\n");
109 $showLink = $this->mybrowser->clickLink(
'Show');
111 $licLink = $this->mybrowser->clickLink(
'LICENSE');
112 $viewLink = $this->makeUrl($this->host, $licLink);
113 $page = $this->mybrowser->get($viewLink);
114 $this->assertTrue($this->myassertText($page,
'/View License/'),
115 "BrowseUploadedTest FAILED!FAIL! View License not found\n");
116 $licenseResult = $this->mybrowser->getContentAsText($viewLink);
117 $this->assertTrue($this->myassertText($licenseResult,
'/100% view LGPL v2\.1/'),
118 "BrowseUploadedTest FAILED!FAIL! Did not find '100% view LGPL v2.1'\n In the License Table for simpletest\n");
Login($User=NULL, $Password=NULL)