mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added functional test runner.
This commit is contained in:
committed by
Endi Sukma Dewata
parent
deaf029023
commit
86995509a1
1
.gitignore
vendored
1
.gitignore
vendored
@@ -47,6 +47,7 @@ install/config.status
|
||||
install/install-sh
|
||||
install/missing
|
||||
install/stamp-h1
|
||||
install/ui/test/results
|
||||
ipa-client/COPYING
|
||||
ipa-client/ChangeLog
|
||||
ipa-client/INSTALL
|
||||
|
||||
33
install/ui/test/bin/functional.sh
Executable file
33
install/ui/test/bin/functional.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN_DIR=`dirname $0`
|
||||
|
||||
TEST_SUITES=functional
|
||||
TEST_RESULTS=results
|
||||
mkdir -p "$TEST_RESULTS"
|
||||
|
||||
LIST=$1
|
||||
shift
|
||||
|
||||
while [ -n "$1" ]
|
||||
do
|
||||
LIST="$LIST $1"
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$LIST" ]
|
||||
then
|
||||
LIST="`ls $TEST_SUITES/*-suite.html | sed 's/^.*\/\(.*\)-suite.html$/\1/'`"
|
||||
fi
|
||||
|
||||
for TEST_NAME in $LIST
|
||||
do
|
||||
echo ===================================================
|
||||
echo Test Suite: $TEST_NAME
|
||||
echo ===================================================
|
||||
|
||||
"$BIN_DIR/selenium.sh" "$TEST_SUITES/$TEST_NAME-suite.html"\
|
||||
"$TEST_RESULTS/$TEST_NAME-results.html"
|
||||
|
||||
rhino -opt -1 "$BIN_DIR/selenium-results.js" "$TEST_RESULTS/$TEST_NAME-results.html"
|
||||
done
|
||||
30
install/ui/test/bin/selenium-results.js
Executable file
30
install/ui/test/bin/selenium-results.js
Executable file
@@ -0,0 +1,30 @@
|
||||
if (!arguments.length) {
|
||||
print('Usage: selenium-results.js <results html>');
|
||||
quit();
|
||||
}
|
||||
|
||||
load('lib/env.rhino.1.2.js');
|
||||
load('../jquery.js');
|
||||
|
||||
window.location = arguments[0];
|
||||
|
||||
var labels = {
|
||||
result: 'Result',
|
||||
numTestTotal: 'Total',
|
||||
numTestPasses: 'Passed',
|
||||
numCommandFailures: 'Failed'
|
||||
};
|
||||
|
||||
$('table:first tr:lt(10)').each(function() {
|
||||
var tr = $(this);
|
||||
|
||||
var td = tr.children().first();
|
||||
|
||||
var name = td.text().replace(/:$/, '');
|
||||
var label = labels[name];
|
||||
if (!label) return;
|
||||
|
||||
td = td.next();
|
||||
var value = td.text();
|
||||
print(label+': '+value);
|
||||
});
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
TEST_SUITE=$1
|
||||
TEST_RESULTS=$2
|
||||
|
||||
@@ -10,17 +9,21 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $TEST_SUITE ]
|
||||
if [ ! -f "$TEST_SUITE" ]
|
||||
then
|
||||
echo "Error: Test suite $TEST_SUITE not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROFILE_DIR=$HOME/.mozilla/firefox
|
||||
PROFILE=`ls $PROFILE_DIR | grep .default`
|
||||
PROFILE_TEMPLATE=$PROFILE_DIR/$PROFILE
|
||||
PROFILE_DIR="$HOME/.mozilla/firefox"
|
||||
PROFILE=`ls "$PROFILE_DIR" | grep .default`
|
||||
PROFILE_TEMPLATE="$PROFILE_DIR/$PROFILE"
|
||||
|
||||
java -jar /usr/share/java/selenium-server-standalone.jar -firefoxProfileTemplate $PROFILE_TEMPLATE -htmlSuite "*firefox" "http://localhost" $TEST_SUITE $TEST_RESULTS
|
||||
# Run Selenium Test
|
||||
java -Djava.util.logging.config.file=conf/logger.properties\
|
||||
-jar /usr/share/java/selenium-server-standalone.jar\
|
||||
-firefoxProfileTemplate "$PROFILE_TEMPLATE"\
|
||||
-htmlSuite "*firefox" "http://localhost" "$TEST_SUITE" "$TEST_RESULTS"
|
||||
|
||||
# Kill Firefox
|
||||
ps -ef|grep -i firefox|grep '\-profile'|awk '{print $2;}'|xargs kill -9
|
||||
ps -ef|grep -i firefox|grep '\-profile'|awk '{print $2;}'|xargs kill
|
||||
|
||||
5
install/ui/test/conf/logger.properties
Normal file
5
install/ui/test/conf/logger.properties
Normal file
@@ -0,0 +1,5 @@
|
||||
handlers = java.util.logging.ConsoleHandler
|
||||
|
||||
.level = OFF
|
||||
|
||||
java.util.logging.ConsoleHandler.level = OFF
|
||||
13989
install/ui/test/lib/env.rhino.1.2.js
Normal file
13989
install/ui/test/lib/env.rhino.1.2.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user