From 01937e3985e1a17a4bfbf084a35cb33452014d24 Mon Sep 17 00:00:00 2001 From: Roland Mas Date: Thu, 18 Oct 2012 15:49:15 +0000 Subject: [PATCH] Added skeleton testsuite for the web UI of the scmgit plugin --- .gitattributes | 1 + src/plugins/scmgit/packaging/links/plugin-scmgit | 1 - tests/DEBDebian60Tests.php | 1 + tests/RPMCentos52Tests.php | 1 + tests/TarCentos52Tests.php | 1 + tests/func/PluginsScmGit/gitTest.php | 58 ++++++++++++++++++++++++ 6 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 tests/func/PluginsScmGit/gitTest.php diff --git a/.gitattributes b/.gitattributes index adebd26..3fbeb5e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4872,6 +4872,7 @@ tests/func/Forums/forumsTest.php -text tests/func/News/newsTest.php -text tests/func/PluginsBlocks/blocksTest.php -text tests/func/PluginsOnlineHelp/contextualHelpTest.php -text +tests/func/PluginsScmGit/gitTest.php -text tests/func/PluginsSvnTracker/trackerTest.php -text tests/func/RBAC/rbacTest.php -text tests/func/README.TXT -text diff --git a/src/plugins/scmgit/packaging/links/plugin-scmgit b/src/plugins/scmgit/packaging/links/plugin-scmgit index be1a152..d064518 100644 --- a/src/plugins/scmgit/packaging/links/plugin-scmgit +++ b/src/plugins/scmgit/packaging/links/plugin-scmgit @@ -1,3 +1,2 @@ /usr/lib/cgi-bin/gitweb.cgi /usr/share/@OLDPACKAGE@/plugins/scmgit/cgi-bin/gitweb.cgi -/usr/share/gitweb /usr/share/@OLDPACKAGE@/www/plugins/scmgit /usr/share/@OLDPACKAGE@/plugins/scmgit/www /usr/share/@OLDPACKAGE@/www/plugins/scmgit diff --git a/tests/DEBDebian60Tests.php b/tests/DEBDebian60Tests.php index 8fb7cf4..943e57c 100644 --- a/tests/DEBDebian60Tests.php +++ b/tests/DEBDebian60Tests.php @@ -30,6 +30,7 @@ class DEBDebian60Tests $suite->addTestFiles(glob("func/Forums/*Test.php")); $suite->addTestFiles(glob("func/News/*Test.php")); $suite->addTestFiles(glob("func/PluginsBlocks/*Test.php")); + $suite->addTestFiles(glob("func/PluginsScmGit/*Test.php")); $suite->addTestFiles(glob("func/RBAC/*Test.php")); $suite->addTestFiles(glob("func/Surveys/*Test.php")); $suite->addTestFiles(glob("func/Search/*Test.php")); diff --git a/tests/RPMCentos52Tests.php b/tests/RPMCentos52Tests.php index df0005e..c639229 100644 --- a/tests/RPMCentos52Tests.php +++ b/tests/RPMCentos52Tests.php @@ -30,6 +30,7 @@ class RPMCentos52Tests $suite->addTestFiles(glob("func/News/*Test.php")); $suite->addTestFiles(glob("func/PluginsBlocks/*Test.php")); $suite->addTestFiles(glob("func/PluginsOnlineHelp/*Test.php")); +// $suite->addTestFiles(glob("func/PluginsScmGit/*Test.php")); // $suite->addTestFiles(glob("func/PluginsSvnTracker/*Test.php")); $suite->addTestFiles(glob("func/RBAC/*Test.php")); $suite->addTestFiles(glob("func/Surveys/*Test.php")); diff --git a/tests/TarCentos52Tests.php b/tests/TarCentos52Tests.php index 4e58bc3..365840c 100755 --- a/tests/TarCentos52Tests.php +++ b/tests/TarCentos52Tests.php @@ -30,6 +30,7 @@ class TarCentos52Tests $suite->addTestFiles(glob("func/News/*Test.php")); $suite->addTestFiles(glob("func/PluginsBlocks/*Test.php")); $suite->addTestFiles(glob("func/PluginsOnlineHelp/*Test.php")); +// $suite->addTestFiles(glob("func/PluginsScmGit/*Test.php")); // $suite->addTestFiles(glob("func/PluginsSvnTracker/*Test.php")); $suite->addTestFiles(glob("func/RBAC/*Test.php")); $suite->addTestFiles(glob("func/Surveys/*Test.php")); diff --git a/tests/func/PluginsScmGit/gitTest.php b/tests/func/PluginsScmGit/gitTest.php new file mode 100644 index 0000000..4bca656 --- /dev/null +++ b/tests/func/PluginsScmGit/gitTest.php @@ -0,0 +1,58 @@ +activatePlugin('scmgit'); + $this->populateStandardTemplate('empty'); + $this->init(); + + $this->open(ROOT); + $this->clickAndWait("link=ProjectA"); + $this->clickAndWait("link=Admin"); + $this->clickAndWait("link=Tools"); + $this->clickAndWait("link=Source Code Admin"); + $this->click("//input[@name='scmradio' and @value='scmgit']"); + $this->clickAndWait("submit"); + + // Run the cronjob to create repositories + $this->cron("cronjobs/create_scm_repos.php"); + + $this->open(ROOT); + $this->clickAndWait("link=ProjectA"); + $this->clickAndWait("link=SCM"); + + $this->assertTextPresent("Anonymous Git Access"); + $this->clickAndWait("link=Request a personal repository"); + $this->assertTextPresent("You have now requested a personal Git repository"); + + // Run the cronjob to create repositories + $this->cron("cronjobs/create_scm_repos.php"); + + $this->clickAndWait("link=SCM"); + $this->assertTextPresent("Access to your personal repository"); + } +} +?> -- 2.1.4