murano-dashboard/functional_tests/run_test.sh
zhurong 3ab9a10055 Add murano dashboard selenium functional test
Depends-On: I12cf2dbc62a25c1a56f7f0f7d54b7df412c2b397
Change-Id: I4b8f7e30c3d78c662bfcd44a5a46cfffc4dd2227
Implements: blueprint dashboard-selenium-tests-migrate-to-infra-ci
2018-01-22 13:05:31 +00:00

39 lines
831 B
Bash
Executable File

DEST=${DEST:-/opt/stack/new}
DASHBOARD_DIR=$DEST/murano-dashboard
function start_xvfb_session() {
export VFB_DISPLAY_SIZE='1280x1024'
export VFB_COLOR_DEPTH=16
export VFB_DISPLAY_NUM=22
export DISPLAY=:${VFB_DISPLAY_NUM}
fonts_path="/usr/share/fonts/X11/misc/"
# Start XVFB session
sudo Xvfb -fp "${fonts_path}" "${DISPLAY}" -screen 0 "${VFB_DISPLAY_SIZE}x${VFB_COLOR_DEPTH}" &
}
function run_nosetests() {
local tests=$*
export NOSETESTS_CMD="$(which nosetests)"
$NOSETESTS_CMD -s -v \
--with-xunit \
--xunit-file="$WORKSPACE/logs/test_report.xml" \
$tests
}
function run_tests() {
sudo rm -f /tmp/parser_table.py
sudo pip install "selenium<3.0.0,>=2.50.1"
cd $DASHBOARD_DIR/muranodashboard/tests/functional
run_nosetests sanity_check
}