Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
339 changes: 0 additions & 339 deletions COPYING

This file was deleted.

30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM php:apache as base
COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apt-get update \
&& apt-get install -y libzip-dev wget unzip \
&& docker-php-ext-install zip

COPY ./ /app
WORKDIR /app

ARG scriptaculous=scriptaculous-js-1.9.0

RUN wget https://script.aculo.us/dist/${scriptaculous}.zip -O /tmp/scriptaculous.zip

RUN unzip /tmp/scriptaculous.zip -d /tmp/

RUN mkdir /app/www/scripts

RUN cp "/tmp/${scriptaculous}/lib/"* /app/www/scripts/
RUN cp "/tmp/${scriptaculous}/src/"* /app/www/scripts/

RUN composer install

RUN ls -R /app/www

RUN chmod -R 777 /app

ENV APACHE_DOCUMENT_ROOT=/app/www
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
30 changes: 0 additions & 30 deletions README

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Web Based Automated Tests

This is a solution to run integration tests using Selenium against Firefox

# INSTALLATION
PHP is not supported anymore by Selenium, this section need to be updated to use Javascript instead

(To be replaced by a docker)
For the Selenium part you need to download [selenium-server-4.0.0-beta-1.jar][Selenium download]

Then run Selenium by

```
java -jar selenium-server-4.0.0-beta-1.jar
```

[//]: # (Reference links)

[Selenium download]: <https://selenium-release.storage.googleapis.com/4.0-beta-1/selenium-server-4.0.0-beta-1.jar>
16 changes: 0 additions & 16 deletions include/AllTests.class.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
<?php
/**
* Copyright (c) STMicroelectronics 2011. All rights reserved
*
* This code 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.
*
* This code 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 code. If not, see <http://www.gnu.org/licenses/>.
*/

require_once 'simpletest/autorun.php';
require_once 'IntegrationTests.class.php';
Expand Down
21 changes: 2 additions & 19 deletions include/BrowserController.class.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
<?php
/**
* Copyright (c) STMicroelectronics 2011. All rights reserved
*
* This code 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.
*
* This code 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 code. If not, see <http://www.gnu.org/licenses/>.
*/

require_once 'Testing/Selenium.php';

/**
* Use SeleniumRC to control the browser
Expand Down Expand Up @@ -87,8 +69,9 @@ function start() {
* Close the browser
*
* @return void
* @static
*/
function stop() {
static function stop() {
if (self::$started) {
self::$selenium->stop();
}
Expand Down
29 changes: 6 additions & 23 deletions include/CustomHtmlReporter.class.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
<?php
/**
* Copyright (c) STMicroelectronics 2011. All rights reserved
*
* This code 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.
*
* This code 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 code. If not, see <http://www.gnu.org/licenses/>.
*/

require_once('simpletest/reporter.php');
#require_once('simpletest/reporter.php');

/**
* Better view of the tests to run & results on the browser
*/
class CustomHtmlReporter extends HtmlReporter {
class CustomHtmlReporter {#extends HtmlReporter {
protected $_timer;

/**
Expand All @@ -30,7 +13,7 @@ class CustomHtmlReporter extends HtmlReporter {
* @return void
*/
function __construct() {
$this->HtmlReporter();
#$this->HtmlReporter();
}

/**
Expand Down Expand Up @@ -62,7 +45,7 @@ function paintFooter($test_name) {
$d = $minutes ? $minutes .' minute' .($minutes > 1 ? 's ' : ' ') : '';
$d .= ($seconds + $micro) .' seconds';
echo '<div style="border:1px solid orange; background: lightyellow; color:orange">Time taken: '. $d .'</div>';
parent::paintFooter($test_name);
#parent::paintFooter($test_name);
}

/**
Expand All @@ -73,7 +56,7 @@ function paintFooter($test_name) {
* @see simpletest/SimpleScorer::paintPass()
*/
function paintPass($message) {
parent::paintPass($message);
#parent::paintPass($message);
if (isset($_REQUEST['show_pass'])) {
print '<span class="pass">Pass</span>: ';
$breadcrumb = $this->getTestList();
Expand All @@ -92,7 +75,7 @@ function paintPass($message) {
*/
function paintFail($message) {
echo '<p><input type="checkbox" onclick="$(this).siblings().invoke(\'toggle\');" /><span>';
parent::paintFail($message);
#parent::paintFail($message);
echo '</span></p>';
}

Expand Down
28 changes: 6 additions & 22 deletions include/IntegrationTests.class.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
<?php
/**
* Copyright (c) STMicroelectronics 2011. All rights reserved
*
* This code 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.
*
* This code 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 code. If not, see <http://www.gnu.org/licenses/>.
*/

require_once('CustomHtmlReporter.class.php');
require_once 'BrowserController.class.php';
require_once 'simpletest/unit_tester.php';
#require_once 'simpletest/unit_tester.php';
require_once 'set.php';

/**
* Class that launches selected tests
*/
class IntegrationTests extends TestSuite {
class IntegrationTests {#extends TestSuite {

/**
* Add given files to the test suite
Expand All @@ -40,7 +23,7 @@ function addFiles($files) {
$fp = fopen('../log/last_run', 'a');
fwrite($fp, "Run on ".date('l jS \of F Y h:i:s A')."\n");
foreach ($files as $file) {
$this->addFile($file);
#$this->addFile($file);
fwrite($fp, basename($file)."\n");
}
fclose($fp);
Expand All @@ -50,11 +33,12 @@ function addFiles($files) {
* Run the test suite then close the browser
*
* @return void
* @static
*
* @see simpletest/TestSuite::run()
*/
function run($reporter) {
parent::run($reporter);
static function run(&$reporter) {
#parent::run($reporter);
BrowserController::stop();
}

Expand Down
20 changes: 1 addition & 19 deletions include/set.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
<?php
/**
* Copyright (c) STMicroelectronics 2011. All rights reserved
*
* This code 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.
*
* This code 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 code. If not, see <http://www.gnu.org/licenses/>.
*/

// Hostname of the server to be tested
$GLOBALS['host'] = 'http://tunlx007.tun.st.com:8999';
$GLOBALS['host'] = 'http://github.com/ounis';

// Primary user that will be used to run tests
$GLOBALS['user'] = 'asma';
Expand Down
Loading