3 * Copyright (C) 2012 Roland Mas
5 * This file is part of FusionForge.
7 * FusionForge is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License,
10 * or (at your option) any later version.
12 * FusionForge is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 require_once dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
24 class ScmGitTest extends FForge_SeleniumTestCase
28 $this->activatePlugin('scmgit');
29 $this->populateStandardTemplate('empty');
33 $this->clickAndWait("link=ProjectA");
34 $this->clickAndWait("link=Admin");
35 $this->clickAndWait("link=Tools");
36 $this->clickAndWait("link=Source Code Admin");
37 $this->click("//input[@name='scmradio' and @value='scmgit']");
38 $this->clickAndWait("submit");
40 $this->type("//input[@name='repo_name']", "other-repo");
41 $this->type("//input[@name='description']", "Description for second repository");
42 $this->clickAndWait("//input[@value='Submit']");
43 $this->assertTextPresent("New repository other-repo registered");
46 $this->clickAndWait("link=ProjectA");
47 $this->clickAndWait("link=SCM");
48 $this->assertTextPresent("other-repo");
50 $this->assertTextPresent("Anonymous Access to the Git");
51 $this->clickAndWait("link=Request a personal repository");
52 $this->assertTextPresent("You have now requested a personal Git repository");
54 // Run the cronjob to create repositories
55 $this->cron("create_scm_repos.php");
57 $this->clickAndWait("link=SCM");
58 $this->assertTextPresent("Access to your personal repository");
60 $this->open(ROOT.'/plugins/scmgit/cgi-bin/gitweb.cgi?a=project_list;pf=projecta');
61 sleep(10); // Gitweb has no <h1> element, so no waitForPageToLoad()
62 $this->assertTextPresent("projecta.git");
63 $this->assertTextPresent("other-repo.git");
64 $this->assertTextPresent("users/".FORGE_ADMIN_USERNAME.".git");
67 $this->clickAndWait("link=ProjectA");
68 $this->clickAndWait("link=Admin");
69 $this->clickAndWait("link=Tools");
70 $this->clickAndWait("link=Source Code Admin");
71 $this->clickAndWait("//form[@name='form_delete_repo_other-repo']/input[@value='Delete']");
72 $this->assertTextPresent("Repository other-repo is marked for deletion");
74 // Run the cronjob to create repositories
75 $this->cron("create_scm_repos.php");
77 $this->open(ROOT.'/plugins/scmgit/cgi-bin/gitweb.cgi?a=project_list;pf=projecta');
78 sleep(10); // Gitweb has no <h1> element, so no waitForPageToLoad()
79 $this->assertTextPresent("projecta.git");
80 $this->assertTextNotPresent("other-repo.git");
81 $this->assertTextPresent("users/".FORGE_ADMIN_USERNAME.".git");