This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, 6.1 has been updated
via d03f514ebcca7326c971a1f4a99f58b899485ec1 (commit)
via a587626603cd4de2c12e282041b4e964f15b2018 (commit)
via b1d30d15c3a43d63cd89c5788c528dbbcf786a28 (commit)
via 31d87f57441eef647836b13d6407c04c92a7f5c5 (commit)
via 0638aef39ad2c79e34c731dbb711e29b7be18be6 (commit)
via 0cc471e6b56f23352fa52f5047962d3d4af77baf (commit)
via 2a4d068c88a817b09e84f52fabe5ecbac59e81c0 (commit)
via 713986c0d345a6dd23b03c10b2b492220f7b2f58 (commit)
via 6ab8ce7135a2a09bf7dcbf27e5738cc4a17cf7f3 (commit)
via 3bbcff1072da46f4a2dfe9e5ba970377540f38ff (commit)
via d43ceef540af49d844c3df85990a5d671bb8694e (commit)
via 3f14fbff61d458af6092f04ee0a835b22d07134a (commit)
via 68f152e2d7959dabfbda5fdad9a79d9ad9cebec8 (commit)
via 1929763c0db2ff4c6d0897770ed0febc3f55dc2b (commit)
via b75d16a36e5d0b1074f86544cb9045669a1a304d (commit)
via 161c7d5cd5d60051cf35cd4af0fe41901cc27293 (commit)
via 38ebe945fb08e309897c35ad8e1d280a2438d5f1 (commit)
via 2e39c922f1f110e83d6da4b2acd34de097f221b2 (commit)
via 7bd914b3087cfe6a0f49c54323ef70ec05dd08f7 (commit)
via a9dbd949664f16fb21dd4c416676e49468d7dbcc (commit)
via ea78a119039ed8cb2256bde2aab8b04da017f4fc (commit)
via 30a21677683f3451d047e0950dc4e329bf282808 (commit)
via aae9a0d9645519c218e63dc770fc1c39661c7d10 (commit)
via a7835c762abd6d41dfd23f2739a2a56a37faea3d (commit)
via ba4515dcf2891583d6d6f2424c62ac6bf3b59cad (commit)
from d581dc189d46681a2e0f4f7a158211c78a1aa80a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d03f514ebcca7326c971a1f4a99f58b899485ec1
commit d03f514ebcca7326c971a1f4a99f58b899485ec1
Author: Franck Villaume <[email protected]>
Date: Wed Jan 16 13:56:43 2019 +0000
implement fix https://github.com/giorgiosironi/phpunit-selenium/issues/427
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index d639455..6f3f716 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -71,10 +71,10 @@ install_selenium() {
if [ -e /etc/debian_version ]; then
apt-get -y install wget firefox-esr net-tools
if grep -q ^8 /etc/debian_version; then
- apt-get -y install phpunit phpunit-selenium psmisc rsyslog
+ apt-get -y install phpunit phpunit-selenium psmisc rsyslog
patch
apt-get -y install -t jessie-backports openjdk-8-jdk
else
- apt-get -y install php-curl unzip composer psmisc rsyslog
default-jre
+ apt-get -y install php-curl unzip composer psmisc rsyslog
default-jre patch
mkdir -p /usr/local/share/php
pushd /usr/local/share/php
composer --no-plugins --no-scripts require phpunit/phpunit
@@ -82,9 +82,8 @@ install_selenium() {
popd
fi
else
- yum -y install wget firefox
- yum install -y java-1.8.0-openjdk
- yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc net-tools
+ yum -y install wget firefox java-1.8.0-openjdk
+ yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc net-tools patch
fi
# Install selenium (no packaged version available)
@@ -114,6 +113,36 @@ install_selenium() {
echo $(hostname -i) $(hostname -f) $(hostname)>> /etc/hosts
fi
grep -q "^$(hostname -i).*$(forge_get_config scm_host)" /etc/hosts ||
sed -i -e "s/^$(hostname -i).*/& $(forge_get_config scm_host)/" /etc/hosts
+
+ #fix https://github.com/giorgiosironi/phpunit-selenium/issues/427
+ patch -N /usr/share/*/PHPUnit/Extensions/Selenium2TestCase/Element.php
<<'EOF' || true
+--- Element.php.dist 2014-11-02 09:23:27.000000000 +0000
++++ Element.php 2019-01-15 15:00:44.034513685 +0000
+@@ -77,10 +77,21 @@
+ PHPUnit_Extensions_Selenium2TestCase_URL $parentFolder,
+ PHPUnit_Extensions_Selenium2TestCase_Driver $driver)
+ {
++ $key = false;
+ if (!isset($value['ELEMENT'])) {
+- throw new InvalidArgumentException('Element not found.');
++ foreach ($value as $lKey => $val) {
++ if (substr($lKey,0,7) === "element") {
++ $key = $lKey;
++ break;
++ }
++ }
++ if (! $key) {
++ throw new InvalidArgumentException('Element not found.');
++ }
++ } else {
++ $key = "ELEMENT";
+ }
+- $url = $parentFolder->descend($value['ELEMENT']);
++ $url = $parentFolder->descend($value[$key]);
+ return new self($driver, $url);
+ }
+
+EOF
}
# Mitigate testsuite timeouts, cf.
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=a587626603cd4de2c12e282041b4e964f15b2018
commit a587626603cd4de2c12e282041b4e964f15b2018
Author: Franck Villaume <[email protected]>
Date: Tue Jan 15 14:19:16 2019 +0000
fix wrong var
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 131fdee..0ff1199 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -193,7 +193,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
public function clickAndWait($link) {
if (preg_match('/^link=/', $link)) {
$text = substr($link, 5);
- $this->byLinkText($link).click();
+ $this->byLinkText($text).click();
}
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b1d30d15c3a43d63cd89c5788c528dbbcf786a28
commit b1d30d15c3a43d63cd89c5788c528dbbcf786a28
Author: Franck Villaume <[email protected]>
Date: Tue Jan 15 10:25:37 2019 +0000
use byLinkText rather than javascript
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 0c34383..131fdee 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -191,10 +191,10 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
public function clickAndWait($link) {
- $this->execute(array(
- 'script' =>
'document.querySelector(\'a[href*="'.$link.'"]\').click()',
- 'args' => array(),
- ));
+ if (preg_match('/^link=/', $link)) {
+ $text = substr($link, 5);
+ $this->byLinkText($link).click();
+ }
}
public function waitForTextPresent($text) {
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=31d87f57441eef647836b13d6407c04c92a7f5c5
commit 31d87f57441eef647836b13d6407c04c92a7f5c5
Author: Franck Villaume <[email protected]>
Date: Mon Jan 14 10:28:00 2019 +0000
implement clickAndWait function
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index d57a811..0c34383 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -191,10 +191,10 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
public function clickAndWait($link) {
- // click does not do what we expect! Need to be rewrite...
- $this->click($link);
- // we may need to implement this waitForPageToLoad... let's
comment it first.
- //$this->waitForPageToLoad();
+ $this->execute(array(
+ 'script' =>
'document.querySelector(\'a[href*="'.$link.'"]\').click()',
+ 'args' => array(),
+ ));
}
public function waitForTextPresent($text) {
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=0638aef39ad2c79e34c731dbb711e29b7be18be6
commit 0638aef39ad2c79e34c731dbb711e29b7be18be6
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 20:45:21 2019 +0100
do not use type, use ByName
diff --git a/tests/func/10_Site/loginTest.php b/tests/func/10_Site/loginTest.php
index 595cb26..72c352e 100644
--- a/tests/func/10_Site/loginTest.php
+++ b/tests/func/10_Site/loginTest.php
@@ -66,7 +66,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->assertRegExp($url_regexp, $location,
"You may need to set 'HOST' setting in test
suite's config file to something compatible with 'web_host' defined in ini
file");
- $this->type("form_loginname", FORGE_ADMIN_USERNAME);
+ $this->byName("form_loginname")->value(FORGE_ADMIN_USERNAME);
$this->type("form_pw", FORGE_ADMIN_PASSWORD);
$this->clickAndWait("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=0cc471e6b56f23352fa52f5047962d3d4af77baf
commit 0cc471e6b56f23352fa52f5047962d3d4af77baf
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 20:44:52 2019 +0100
fix isTextPresent, implement getLocation, start clickAndWait rewrite
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 3cc37e0..d57a811 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -191,8 +191,10 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
public function clickAndWait($link) {
+ // click does not do what we expect! Need to be rewrite...
$this->click($link);
- $this->waitForPageToLoad();
+ // we may need to implement this waitForPageToLoad... let's
comment it first.
+ //$this->waitForPageToLoad();
}
public function waitForTextPresent($text) {
@@ -379,7 +381,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
public function logout() {
// $this->click("link=Log Out");
$this->open( ROOT ."/account/logout.php" );
- $this->waitForPageToLoad();
+ //$this->waitForPageToLoad();
$this->logged_in = false ;
}
@@ -569,7 +571,17 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
'args' => array(),
));
$element = $this->elementFromResponseValue($elementArray);
- $this->assertRegExp("/$text/", $element->text());
+ if (strpos($element->text(), $text) === false) {
+ return false;
+ }
+ return true;
+ }
+
+ function getLocation() {
+ return $this->execute(array(
+ 'script' => 'return window.location.href;',
+ 'args' => array(),
+ ));
}
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=2a4d068c88a817b09e84f52fabe5ecbac59e81c0
commit 2a4d068c88a817b09e84f52fabe5ecbac59e81c0
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 19:33:39 2019 +0100
implement isTextPresent using
https://github.com/giorgiosironi/phpunit-selenium/blob/b8c6494b977f79098e748343455f129af3fdb292/Tests/Selenium2TestCaseTest.php
as example
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 3214c87..3cc37e0 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -44,6 +44,40 @@
* ALONE BASIS."
*/
+/**
+ *Copyright (c) 2010-2013, Sebastian Bergmann <[email protected]>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of Sebastian Bergmann nor the names of his
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
define('FORGE_ADMIN_USERNAME', 'admin');
define('FORGE_ADMIN_PASSWORD', 'my_Admin7');
define('FORGE_OTHER_PASSWORD', 'toto_Tata8');
@@ -528,6 +562,15 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
function open($url) {
$this->url($url);
}
+
+ function isTextPresent($text) {
+ $elementArray = $this->execute(array(
+ 'script' => 'return document.body;',
+ 'args' => array(),
+ ));
+ $element = $this->elementFromResponseValue($elementArray);
+ $this->assertRegExp("/$text/", $element->text());
+ }
}
// Local Variables:
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=713986c0d345a6dd23b03c10b2b492220f7b2f58
commit 713986c0d345a6dd23b03c10b2b492220f7b2f58
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 19:29:15 2019 +0100
drop obsolete patch
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 5f615e5..d639455 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -71,10 +71,10 @@ install_selenium() {
if [ -e /etc/debian_version ]; then
apt-get -y install wget firefox-esr net-tools
if grep -q ^8 /etc/debian_version; then
- apt-get -y install phpunit phpunit-selenium patch psmisc
patch rsyslog
+ apt-get -y install phpunit phpunit-selenium psmisc rsyslog
apt-get -y install -t jessie-backports openjdk-8-jdk
else
- apt-get -y install php-curl unzip composer patch psmisc
patch rsyslog default-jre
+ apt-get -y install php-curl unzip composer psmisc rsyslog
default-jre
mkdir -p /usr/local/share/php
pushd /usr/local/share/php
composer --no-plugins --no-scripts require phpunit/phpunit
@@ -84,7 +84,7 @@ install_selenium() {
else
yum -y install wget firefox
yum install -y java-1.8.0-openjdk
- yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc patch net-tools
+ yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc net-tools
fi
# Install selenium (no packaged version available)
@@ -114,23 +114,6 @@ install_selenium() {
echo $(hostname -i) $(hostname -f) $(hostname)>> /etc/hosts
fi
grep -q "^$(hostname -i).*$(forge_get_config scm_host)" /etc/hosts ||
sed -i -e "s/^$(hostname -i).*/& $(forge_get_config scm_host)/" /etc/hosts
-
- # Fix screenshot default black background (/usr/share/{php,pear}) (fix
available upstream)
- if [ -e /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php ] ; then
- patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php
<<'EOF' || true
---- /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php-dist
2014-02-10 19:48:34.000000000 +0000
-+++ /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php 2014-09-01
10:09:38.823051288 +0000
-@@ -1188,7 +1188,7 @@
- !empty($this->screenshotUrl)) {
- $filename = $this->getScreenshotPath() . $this->testId . '.png';
-
-- $this->drivers[0]->captureEntirePageScreenshot($filename);
-+ $this->drivers[0]->captureEntirePageScreenshot($filename,
'background=#CCFFDD');
-
- return 'Screenshot: ' . $this->screenshotUrl . '/' .
- $this->testId . ".png\n";
-EOF
- fi
}
# Mitigate testsuite timeouts, cf.
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=6ab8ce7135a2a09bf7dcbf27e5738cc4a17cf7f3
commit 6ab8ce7135a2a09bf7dcbf27e5738cc4a17cf7f3
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 18:08:42 2019 +0100
implement open in SeleniumForge class
diff --git a/tests/func/10_Site/loginTest.php b/tests/func/10_Site/loginTest.php
index f722451..595cb26 100644
--- a/tests/func/10_Site/loginTest.php
+++ b/tests/func/10_Site/loginTest.php
@@ -49,7 +49,7 @@ class LoginProcess extends FForge_SeleniumTestCase
function testLogin()
{
// Test with a normal login.
- $this->url( ROOT );
+ $this->open( ROOT );
if (!$this->isTextPresent("Log In")) {
$this->logout();
}
@@ -71,16 +71,16 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
- $this->url( ROOT );
+ $this->open( ROOT );
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
$this->logout();
- $this->url( ROOT );
+ $this->open( ROOT );
// Verify that logout is succesful
$this->assertTrue($this->isTextPresent("Log In"));
// Test with an empty password.
- $this->url( ROOT );
+ $this->open( ROOT );
$this->clickAndWait("link=Log In");
$this->assertTrue($this->isTextPresent("Log In"));
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
@@ -92,7 +92,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->assertTrue($this->isTextPresent("Log In"));
// Test with a wrong password.
- $this->url( ROOT );
+ $this->open( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", "awrongpassword");
@@ -114,7 +114,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("submit");
$this->logout();
- $this->url( ROOT );
+ $this->open( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", FORGE_OTHER_PASSWORD);
@@ -139,7 +139,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("submit");
$this->logout();
- $this->url( ROOT );
+ $this->open( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", FORGE_ADMIN_PASSWORD);
@@ -148,7 +148,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->assertTrue($this->isTextPresent("Log Out"));
// Test session expiration
- $this->url( ROOT );
+ $this->open( ROOT );
if (!$this->isTextPresent("Log In")) {
$this->logout();
}
@@ -158,24 +158,24 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
- $this->url( ROOT );
+ $this->open( ROOT );
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
// Shorten session validity delay
$this->changeConfig(array("core" => array("session_expire" =>
"10")));
// Ensure session cookie is refreshed
sleep(5);
- $this->url( ROOT );
+ $this->open( ROOT );
sleep(5);
- $this->url( ROOT );
+ $this->open( ROOT );
sleep(5);
- $this->url( ROOT );
+ $this->open( ROOT );
sleep(5);
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
// Now ensure that the session expires
sleep(15);
- $this->url( ROOT );
+ $this->open( ROOT );
$this->assertFalse($this->isTextPresent("Forge Admin"));
$this->assertFalse($this->isTextPresent("Log Out"));
}
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 88343d4..3214c87 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -520,6 +520,14 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->skip_test($msg);
}
}
+
+ /**
+ * add PHP wrappers for SeleniumTestCase compatibility
+ */
+
+ function open($url) {
+ $this->url($url);
+ }
}
// Local Variables:
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=3bbcff1072da46f4a2dfe9e5ba970377540f38ff
commit 3bbcff1072da46f4a2dfe9e5ba970377540f38ff
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 17:59:33 2019 +0100
coding style
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 832ec0f..88343d4 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -156,14 +156,12 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
}
- public function clickAndWait($link)
- {
+ public function clickAndWait($link) {
$this->click($link);
$this->waitForPageToLoad();
}
- public function waitForTextPresent($text)
- {
+ public function waitForTextPresent($text) {
for ($second = 0; ; $second++) {
if ($second >= 30) $this->fail("timeout");
try {
@@ -173,8 +171,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
}
- public function runCommand($cmd)
- {
+ public function runCommand($cmd) {
system($cmd, $ret);
$this->assertEquals(0, $ret);
ob_flush();
@@ -195,21 +192,18 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
ob_flush();
}
- public function cron($cmd)
- {
+ public function cron($cmd) {
$this->runCommand("forge_run_job $cmd");
}
- public function cron_for_plugin($cmd, $plugin)
- {
+ public function cron_for_plugin($cmd, $plugin) {
$this->runCommand("forge_run_plugin_job $plugin $cmd");
}
- /**
- * Execute pending system tasks
- */
- public function waitSystasks()
- {
+ /**
+ * Execute pending system tasks
+ */
+ public function waitSystasks() {
$this->runCommand(dirname(__FILE__).'/../../src/bin/systasks_wait_until_empty.php');
}
@@ -217,8 +211,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->createAndGoto('ProjectA');
}
- public function populateStandardTemplate($what='all')
- {
+ public function populateStandardTemplate($what='all') {
if ($what == 'all') {
$what = array('trackers','tasks','forums');
} elseif ($what == 'empty') {
@@ -326,8 +319,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
}
- public function login($username)
- {
+ public function login($username) {
$this->open( ROOT );
if ($this->isTextPresent('Log Out')) {
$this->logout();
@@ -336,8 +328,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->triggeredLogin($username);
}
- public function triggeredLogin($username)
- {
+ public function triggeredLogin($username) {
if ($username == FORGE_ADMIN_USERNAME) {
$password = FORGE_ADMIN_PASSWORD;
} else {
@@ -351,8 +342,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->logged_in = $username ;
}
- public function logout()
- {
+ public function logout() {
// $this->click("link=Log Out");
$this->open( ROOT ."/account/logout.php" );
$this->waitForPageToLoad();
@@ -360,21 +350,18 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->logged_in = false ;
}
- public function switchUser($username)
- {
+ public function switchUser($username) {
if ($this->logged_in != $username) {
$this->logout();
$this->login($username);
}
}
- public function isLoginRequired()
- {
+ public function isLoginRequired() {
return $this->isTextPresent("You've been redirected to this
login page") ;
}
- public function isPermissionDenied()
- {
+ public function isPermissionDenied() {
return $this->isTextPresent("Permission denied") ;
}
@@ -431,8 +418,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->gotoProject($project);
}
- public function createUser ($login)
- {
+ public function createUser ($login) {
$this->switchUser(FORGE_ADMIN_USERNAME);
$this->open( ROOT );
$this->clickAndWait("link=Site Admin");
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d43ceef540af49d844c3df85990a5d671bb8694e
commit d43ceef540af49d844c3df85990a5d671bb8694e
Author: Franck Villaume <[email protected]>
Date: Sun Jan 13 17:54:23 2019 +0100
add missing licence & tabs
diff --git a/tests/code_and_unit_tests.php b/tests/code_and_unit_tests.php
index 82175f9..6385b88 100644
--- a/tests/code_and_unit_tests.php
+++ b/tests/code_and_unit_tests.php
@@ -1,4 +1,23 @@
<?php
+/**
+ * Copyright FusionForge Team
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'AllTests::main');
}
@@ -11,15 +30,12 @@ if (!@include_once 'PHPUnit/Autoload.php') {
@include_once 'PHP/Token/Stream/Autoload.php';
@include_once 'Text/Template/Autoload.php';
-class AllTests
-{
- public static function main()
- {
- PHPUnit_TextUI_TestRunner::run(self::suite());
+class AllTests {
+ public static function main() {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
}
- public static function suite()
- {
+ public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('PHPUnit');
// Unit tests
diff --git a/tests/func_tests.php b/tests/func_tests.php
index 45c1c3c..2c7211a 100644
--- a/tests/func_tests.php
+++ b/tests/func_tests.php
@@ -1,4 +1,24 @@
<?php
+/**
+ * Copyright FusionForge Team
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'AllTests::main');
}
@@ -15,22 +35,20 @@ if (@include_once
'/usr/local/share/php/vendor/autoload.php') {
}
}
-class AllTests
-{
- public static function main()
- {
- PHPUnit_TextUI_TestRunner::run(self::suite());
+class AllTests {
+ public static function main() {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
}
- public static function suite()
- {
+ public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('PHPUnit');
// Selenium tests
- if (getenv('TESTGLOB') != FALSE)
+ if (getenv('TESTGLOB') != FALSE) {
$files = glob(dirname(__FILE__).'/'.getenv('TESTGLOB'));
- else
+ } else {
$files = glob(dirname(__FILE__).'/func/*/*Test.php');
+ }
natsort($files);
$suite->addTestFiles($files);
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=3f14fbff61d458af6092f04ee0a835b22d07134a
commit 3f14fbff61d458af6092f04ee0a835b22d07134a
Author: Franck Villaume <[email protected]>
Date: Thu Jan 10 21:05:03 2019 +0100
accept insecure SSL certificates in test suite
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 0be1d4a..832ec0f 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -77,6 +77,8 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
}
$this->setBrowser('firefox');
+ $capabilities = array('acceptInsecureCerts' => true);
+ $this->setDesiredCapabilities($capabilities);
$this->setBrowserUrl(URL);
$this->setHost(SELENIUM_RC_HOST);
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=68f152e2d7959dabfbda5fdad9a79d9ad9cebec8
commit 68f152e2d7959dabfbda5fdad9a79d9ad9cebec8
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 14:42:12 2019 +0000
try with url vs. open
diff --git a/tests/func/10_Site/loginTest.php b/tests/func/10_Site/loginTest.php
index 595cb26..f722451 100644
--- a/tests/func/10_Site/loginTest.php
+++ b/tests/func/10_Site/loginTest.php
@@ -49,7 +49,7 @@ class LoginProcess extends FForge_SeleniumTestCase
function testLogin()
{
// Test with a normal login.
- $this->open( ROOT );
+ $this->url( ROOT );
if (!$this->isTextPresent("Log In")) {
$this->logout();
}
@@ -71,16 +71,16 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
- $this->open( ROOT );
+ $this->url( ROOT );
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
$this->logout();
- $this->open( ROOT );
+ $this->url( ROOT );
// Verify that logout is succesful
$this->assertTrue($this->isTextPresent("Log In"));
// Test with an empty password.
- $this->open( ROOT );
+ $this->url( ROOT );
$this->clickAndWait("link=Log In");
$this->assertTrue($this->isTextPresent("Log In"));
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
@@ -92,7 +92,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->assertTrue($this->isTextPresent("Log In"));
// Test with a wrong password.
- $this->open( ROOT );
+ $this->url( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", "awrongpassword");
@@ -114,7 +114,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("submit");
$this->logout();
- $this->open( ROOT );
+ $this->url( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", FORGE_OTHER_PASSWORD);
@@ -139,7 +139,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("submit");
$this->logout();
- $this->open( ROOT );
+ $this->url( ROOT );
$this->clickAndWait("link=Log In");
$this->type("form_loginname", FORGE_ADMIN_USERNAME);
$this->type("form_pw", FORGE_ADMIN_PASSWORD);
@@ -148,7 +148,7 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->assertTrue($this->isTextPresent("Log Out"));
// Test session expiration
- $this->open( ROOT );
+ $this->url( ROOT );
if (!$this->isTextPresent("Log In")) {
$this->logout();
}
@@ -158,24 +158,24 @@ class LoginProcess extends FForge_SeleniumTestCase
$this->clickAndWait("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
- $this->open( ROOT );
+ $this->url( ROOT );
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
// Shorten session validity delay
$this->changeConfig(array("core" => array("session_expire" =>
"10")));
// Ensure session cookie is refreshed
sleep(5);
- $this->open( ROOT );
+ $this->url( ROOT );
sleep(5);
- $this->open( ROOT );
+ $this->url( ROOT );
sleep(5);
- $this->open( ROOT );
+ $this->url( ROOT );
sleep(5);
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
// Now ensure that the session expires
sleep(15);
- $this->open( ROOT );
+ $this->url( ROOT );
$this->assertFalse($this->isTextPresent("Forge Admin"));
$this->assertFalse($this->isTextPresent("Log Out"));
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1929763c0db2ff4c6d0897770ed0febc3f55dc2b
commit 1929763c0db2ff4c6d0897770ed0febc3f55dc2b
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 13:14:34 2019 +0000
new try with full path + binary for geckodriver
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 6d98b94..5f615e5 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -210,7 +210,7 @@ killall -9 java || true
timeout=60
export
PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
export LANG=C
-java -Dwebdriver.gecko.driver=/usr/share/geckodriver -jar
/usr/share/selenium/selenium-server.jar &
+java -Dwebdriver.gecko.driver=/usr/share/geckodriver/geckodriver -jar
/usr/share/selenium/selenium-server.jar &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b75d16a36e5d0b1074f86544cb9045669a1a304d
commit b75d16a36e5d0b1074f86544cb9045669a1a304d
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 12:49:02 2019 +0000
use firefox
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 698ac67..0be1d4a 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -76,7 +76,7 @@ class FForge_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase
$this->screenshotUrl = getenv('SELENIUM_RC_URL');
}
- $this->setBrowser('*firefox');
+ $this->setBrowser('firefox');
$this->setBrowserUrl(URL);
$this->setHost(SELENIUM_RC_HOST);
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=161c7d5cd5d60051cf35cd4af0fe41901cc27293
commit 161c7d5cd5d60051cf35cd4af0fe41901cc27293
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 12:39:40 2019 +0000
browser = firefox
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 1d44822..6d98b94 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -102,6 +102,7 @@ install_selenium() {
GECKODRIVERMICRO=0
GECKODRIVERURL=https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO/geckodriver-v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO-linux64.tar.gz
mkdir -p /usr/share/geckodriver/
+ rm -f /usr/share/geckodriver/geckodriver*
http_proxy=$PROXY wget -c $GECKODRIVERURL \
-O /usr/share/geckodriver/geckodriver.tar.gz
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=38ebe945fb08e309897c35ad8e1d280a2438d5f1
commit 38ebe945fb08e309897c35ad8e1d280a2438d5f1
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 12:13:40 2019 +0000
use latest geckodriver
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 43806de..1d44822 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -98,8 +98,8 @@ install_selenium() {
# Install GeckoDriver
GECKODRIVERMAJOR=0
- GECKODRIVERMINOR=19
- GECKODRIVERMICRO=1
+ GECKODRIVERMINOR=23
+ GECKODRIVERMICRO=0
GECKODRIVERURL=https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO/geckodriver-v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO-linux64.tar.gz
mkdir -p /usr/share/geckodriver/
http_proxy=$PROXY wget -c $GECKODRIVERURL \
@@ -209,7 +209,7 @@ killall -9 java || true
timeout=60
export
PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
export LANG=C
-java -Dwebdriver.gecko.driver=/usr/share/geckodriver/geckodriver -jar
/usr/share/selenium/selenium-server.jar &
+java -Dwebdriver.gecko.driver=/usr/share/geckodriver -jar
/usr/share/selenium/selenium-server.jar &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=2e39c922f1f110e83d6da4b2acd34de097f221b2
commit 2e39c922f1f110e83d6da4b2acd34de097f221b2
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 10:49:02 2019 +0000
specify gecko driver
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 63d9e1c..43806de 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -207,7 +207,9 @@ EOF
echo "Starting Selenium"
killall -9 java || true
timeout=60
-PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
LANG=C java -jar /usr/share/selenium/selenium-server.jar &
+export
PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
+export LANG=C
+java -Dwebdriver.gecko.driver=/usr/share/geckodriver/geckodriver -jar
/usr/share/selenium/selenium-server.jar &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7bd914b3087cfe6a0f49c54323ef70ec05dd08f7
commit 7bd914b3087cfe6a0f49c54323ef70ec05dd08f7
Author: Franck Villaume <[email protected]>
Date: Wed Jan 9 10:13:50 2019 +0000
upgrade to latest selenium
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 3beae1c..63d9e1c 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -89,8 +89,8 @@ install_selenium() {
# Install selenium (no packaged version available)
SELENIUMMAJOR=3
- SELENIUMMINOR=8
- SELENIUMMICRO=1
+ SELENIUMMINOR=141
+ SELENIUMMICRO=59
SELENIUMURL=http://selenium-release.storage.googleapis.com/$SELENIUMMAJOR.$SELENIUMMINOR/selenium-server-standalone-$SELENIUMMAJOR.$SELENIUMMINOR.$SELENIUMMICRO.jar
mkdir -p /usr/share/selenium/
http_proxy=$PROXY wget -c $SELENIUMURL \
@@ -207,7 +207,7 @@ EOF
echo "Starting Selenium"
killall -9 java || true
timeout=60
-PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
LANG=C java -jar /usr/share/selenium/selenium-server.jar -enablePassThrough
false &
+PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
LANG=C java -jar /usr/share/selenium/selenium-server.jar &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=a9dbd949664f16fb21dd4c416676e49468d7dbcc
commit a9dbd949664f16fb21dd4c416676e49468d7dbcc
Author: Franck Villaume <[email protected]>
Date: Tue Jan 8 22:36:30 2019 +0100
use Selenium2
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 555d955..698ac67 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -58,7 +58,7 @@ if (@include_once '/usr/local/share/php/vendor/autoload.php')
{
}
-class FForge_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
+class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
{
public $logged_in = false ;
public $fixture = 'base';
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ea78a119039ed8cb2256bde2aab8b04da017f4fc
commit ea78a119039ed8cb2256bde2aab8b04da017f4fc
Author: Franck Villaume <[email protected]>
Date: Tue Jan 8 22:17:26 2019 +0100
Use Selenium2TestCase
diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 07e187a..555d955 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -54,7 +54,7 @@ require_once $config;
if (@include_once '/usr/local/share/php/vendor/autoload.php') {
class PHPUnit_Extensions_SeleniumTestCase extends
PHPUnit_Extensions_Selenium2TestCase {}
} else {
- require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+ require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=30a21677683f3451d047e0950dc4e329bf282808
commit 30a21677683f3451d047e0950dc4e329bf282808
Author: Franck Villaume <[email protected]>
Date: Mon Jan 7 14:58:30 2019 +0000
fix tar output dir
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index 5195ecc..3beae1c 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -105,7 +105,7 @@ install_selenium() {
http_proxy=$PROXY wget -c $GECKODRIVERURL \
-O /usr/share/geckodriver/geckodriver.tar.gz
- tar -zxf /usr/share/geckodriver/geckodriver.tar.gz
+ tar -zxf /usr/share/geckodriver/geckodriver.tar.gz -C
/usr/share/geckodriver/
chmod +x /usr/share/geckodriver/geckodriver
# Add alias to /etc/hosts
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=aae9a0d9645519c218e63dc770fc1c39661c7d10
commit aae9a0d9645519c218e63dc770fc1c39661c7d10
Author: Franck Villaume <[email protected]>
Date: Mon Jan 7 14:00:56 2019 +0000
fix typo
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index e55c641..5195ecc 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -100,7 +100,7 @@ install_selenium() {
GECKODRIVERMAJOR=0
GECKODRIVERMINOR=19
GECKODRIVERMICRO=1
-
GECKORDRIVERURL=https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO/geckodriver-v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO-linux64.tar.gz
+
GECKODRIVERURL=https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO/geckodriver-v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO-linux64.tar.gz
mkdir -p /usr/share/geckodriver/
http_proxy=$PROXY wget -c $GECKODRIVERURL \
-O /usr/share/geckodriver/geckodriver.tar.gz
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=a7835c762abd6d41dfd23f2739a2a56a37faea3d
commit a7835c762abd6d41dfd23f2739a2a56a37faea3d
Author: Franck Villaume <[email protected]>
Date: Mon Jan 7 13:29:52 2019 +0000
add missing geckodriver
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index d76afc6..e55c641 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -96,6 +96,18 @@ install_selenium() {
http_proxy=$PROXY wget -c $SELENIUMURL \
-O /usr/share/selenium/selenium-server.jar
+ # Install GeckoDriver
+ GECKODRIVERMAJOR=0
+ GECKODRIVERMINOR=19
+ GECKODRIVERMICRO=1
+
GECKORDRIVERURL=https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO/geckodriver-v$GECKODRIVERMAJOR.$GECKODRIVERMINOR.$GECKODRIVERMICRO-linux64.tar.gz
+ mkdir -p /usr/share/geckodriver/
+ http_proxy=$PROXY wget -c $GECKODRIVERURL \
+ -O /usr/share/geckodriver/geckodriver.tar.gz
+
+ tar -zxf /usr/share/geckodriver/geckodriver.tar.gz
+ chmod +x /usr/share/geckodriver/geckodriver
+
# Add alias to /etc/hosts
if ! grep -q ^$(hostname -i) /etc/hosts ; then
echo $(hostname -i) $(hostname -f) $(hostname)>> /etc/hosts
@@ -195,7 +207,7 @@ EOF
echo "Starting Selenium"
killall -9 java || true
timeout=60
-PATH=/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH LANG=C
java -jar /usr/share/selenium/selenium-server.jar -enablePassThrough false &
+PATH=/usr/share/geckodriver:/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH
LANG=C java -jar /usr/share/selenium/selenium-server.jar -enablePassThrough
false &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ba4515dcf2891583d6d6f2424c62ac6bf3b59cad
commit ba4515dcf2891583d6d6f2424c62ac6bf3b59cad
Author: Franck Villaume <[email protected]>
Date: Sun Jan 6 18:57:51 2019 +0100
include lot of fixes & start to try to make it work with selenium 3.8.1 &
latest firefox...
diff --git a/tests/func_tests.sh b/tests/func_tests.sh
index de39693..d76afc6 100755
--- a/tests/func_tests.sh
+++ b/tests/func_tests.sh
@@ -52,12 +52,14 @@ esac
fix_httpd_itk() {
case $INSTALL_OS in
centos*)
- echo 'WARNING: WORKAROUND for docker/lxc. Downgrade
httpd-itk.'
- echo 'TODO: check for newer version. Debian not
impacted.'
- curl
https://kojipkgs.fedoraproject.org//packages/httpd-itk/2.4.7.04/1.el7/x86_64/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
-o /tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
- yum downgrade -y
/tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
- rm -f /tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
- service httpd restart || true
+ if [[ `rpm -qi httpd-itk | grep Release | awk '{print
$3}'` != '1.el7' ]]; then
+ echo 'WARNING: WORKAROUND for docker/lxc.
Downgrade httpd-itk.'
+ echo 'TODO: check for newer version. Debian not
impacted.'
+ curl
https://kojipkgs.fedoraproject.org//packages/httpd-itk/2.4.7.04/1.el7/x86_64/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
-o /tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
+ yum downgrade -y
/tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
+ rm -f /tmp/httpd-itk-2.4.7.04-1.el7.x86_64.rpm
+ service httpd restart || true
+ fi
;;
esac
}
@@ -67,12 +69,12 @@ install_selenium() {
# psmisc for db_reload.sh:killall
# rsyslog to get e.g. sshd error log
if [ -e /etc/debian_version ]; then
- ICEWEASEL_VERSION=`apt-cache show firefox-esr | grep Version |
grep -v '60' | cut -f 2 -d' '`
- apt-get -y install wget default-jre
firefox-esr=$ICEWEASEL_VERSION
+ apt-get -y install wget firefox-esr net-tools
if grep -q ^8 /etc/debian_version; then
apt-get -y install phpunit phpunit-selenium patch psmisc
patch rsyslog
+ apt-get -y install -t jessie-backports openjdk-8-jdk
else
- apt-get -y install php-curl unzip composer patch psmisc
patch rsyslog
+ apt-get -y install php-curl unzip composer patch psmisc
patch rsyslog default-jre
mkdir -p /usr/local/share/php
pushd /usr/local/share/php
composer --no-plugins --no-scripts require phpunit/phpunit
@@ -81,19 +83,13 @@ install_selenium() {
fi
else
yum -y install wget firefox
- if yum list java-1.7.0-openjdk >/dev/null 2>&1 ; then
- yum install -y java-1.7.0-openjdk
- else
- yum install -y java-1.6.0
- fi
+ yum install -y java-1.8.0-openjdk
yum --enablerepo=epel install -y php-phpunit-PHPUnit
php-phpunit-PHPUnit-Selenium psmisc patch net-tools
- # Firefox > 60 does not work with Selenium 2
- yum downgrade -y firefox-52.8.0-1.el7.centos
fi
# Install selenium (no packaged version available)
- SELENIUMMAJOR=2
- SELENIUMMINOR=53
+ SELENIUMMAJOR=3
+ SELENIUMMINOR=8
SELENIUMMICRO=1
SELENIUMURL=http://selenium-release.storage.googleapis.com/$SELENIUMMAJOR.$SELENIUMMINOR/selenium-server-standalone-$SELENIUMMAJOR.$SELENIUMMINOR.$SELENIUMMICRO.jar
mkdir -p /usr/share/selenium/
@@ -199,7 +195,7 @@ EOF
echo "Starting Selenium"
killall -9 java || true
timeout=60
-PATH=/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH LANG=C
java -jar /usr/share/selenium/selenium-server.jar -trustAllSSLCertificates
-singleWindow &
+PATH=/usr/lib/iceweasel:/usr/lib/firefox-esr:/usr/lib64/firefox:$PATH LANG=C
java -jar /usr/share/selenium/selenium-server.jar -enablePassThrough false &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 &&
kill -0 $pid 2>/dev/null; do
-----------------------------------------------------------------------
Summary of changes:
tests/code_and_unit_tests.php | 30 +++++++---
tests/func/10_Site/loginTest.php | 2 +-
tests/func/SeleniumForge.php | 125 +++++++++++++++++++++++++++------------
tests/func_tests.php | 36 ++++++++---
tests/func_tests.sh | 97 ++++++++++++++++++------------
5 files changed, 199 insertions(+), 91 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits