...
  View open merge request
Commits (8)
......@@ -216,14 +216,14 @@ test_browser_unit:
tags:
- web
test_browser-functional:
.browser-functional:
stage: test_functional
retry: 2
script:
- make -C browser
- source /etc/profile.d/rvm.sh
- rvm use 2.6.1
- HEADLESS=1 make -C browser/test functional BROWSERS=--browsers-from-file
- HEADLESS=1 make -C browser/test functional
artifacts:
paths:
- browser/
......@@ -232,10 +232,8 @@ test_browser-functional:
- /^hotfix-.*c.*\/.*$/
- prod-client
- schedules
tags:
- web
test_browser-functional-external:
.browser-functional-external:
stage: test_functional_external
retry: 2
script:
......@@ -251,9 +249,38 @@ test_browser-functional-external:
- /^hotfix-.*c.*\/.*$/
- prod-client
- schedules
test_browser-functional:
extends: .browser-functional
variables:
BROWSERS: "--browsers-from-file"
tags:
- web
test_legacy-browser-functional:
extends: .browser-functional
variables:
WATIR_CHROME: "1"
IGNORE_FUNCTIONAL_CBP: "1"
tags:
- legacy
test_browser-functional-external:
extends: .browser-functional-external
variables:
BROWSERS: "--browsers-from-file"
tags:
- web
test_legacy-browser-functional-external:
extends: .browser-functional-external
variables:
WATIR_CHROME: "1"
IGNORE_FUNCTIONAL_CBP: "1"
tags:
- legacy
code_quality:
stage: test_quality
script: make -C browser quality
......@@ -307,7 +334,7 @@ test_server_functional:
- docker exec docker_nginx_1 make -C /usr/share/vidjil browser
- source /etc/profile.d/rvm.sh
- rvm use 2.6.1
- HEADLESS=1 make functional_server || (cd docker && docker-compose stop; docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker rmi "vidjil/server:test" "vidjil/client:test"; false)
- HEADLESS=1 make functional_server BROWSERS="--browsers-from-file" || (cd docker && docker-compose stop; docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker rmi "vidjil/server:test" "vidjil/client:test"; false)
- cd docker && docker-compose stop
- docker stop $(docker ps -aq)
- docker rm $(docker ps -aq)
......
......@@ -170,7 +170,11 @@ Url.prototype= {
pushUrl: function(params) {
var new_url = "?" + params;
this.window.history.pushState('plop', 'plop', new_url);
try {
this.window.history.pushState('plop', 'plop', new_url);
} catch(error) {
console.log(error);
}
},
getStraightParams: function() {
......
BROWSERS=
all: unit functional
unit: nightmare
......
......@@ -199,6 +199,9 @@ class TestMultilocus < BrowserTest
name.click
$b.until { not $b.tag_item('0')[:name].present? }
# Move the mouse elsewhere
$b.clone_in_scatterplot('77').hover
$b.until {$b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' }
end
end
......@@ -374,6 +377,9 @@ class TestMultilocus < BrowserTest
$b.clone_info('25')[:star].click
$b.element(:id => 'tagElem_0').click
# Move the mouse elsewhere
$b.clone_in_scatterplot('72').hover
$b.until {$b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' } # clone 25 should have changed color
assert ( not $b.clone_info('88')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , "clone 88 (second of the selection) haven't chaged color "
......
# sh launch_functional_tests functional/test_*rb
if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" -o ! -z "$IGNORE_FUNCTIONAL_CBP" ]; then
FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi
if [ "$1" = "--browsers-from-file" ]
then
shift
if [ ! -f ./tested-browsers ]; then
exit 1
fi
BROWSER_LIST=`sed "s#^#$FUNCTIONAL_CLIENT_BROWSER_DIR#" ./tested-browsers`
else
BROWSER_LIST=$FUNCTIONAL_CLIENT_BROWSER_PATH
......
......@@ -4,6 +4,6 @@ headless:
HEADLESS=1 $(MAKE) functional
functional:
sh launch_functional_tests functional/test_*.rb
sh launch_functional_tests $(BROWSERS) functional/test_*.rb
.PHONY: all functional headless
# sh launch_functional_tests functional/test_*rb
FUNCTIONAL_TESTS=$*
rename_reports_in() {
dir="$1"
b="$2"
if [ "$b" = "." ]; then
b="default"
else
b=$(echo "$b" | tr '/' '-')
fi
for file in $1/*.xml; do
filename=$(basename -s .xml $file)
mv $file $dir/$filename-$b.xml
done
}
rm -f test/*.xml
EXIT=0
if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi
for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do
sh init_func_test_db.sh
for file in $FUNCTIONAL_TESTS; do
if [ ${#browser} -gt 1 ]; then
export WATIR_BROWSER_PATH="$browser"
fi
ruby -I functional $file;
TMP_EXIT=$?
if [ $TMP_EXIT -ne 0 ]; then
EXIT=$TMP_EXIT
fi
rename_reports_in test/reports/ "$browser"
mv test/reports/*.xml test/
done
done
exit $EXIT
../../../../../browser/test/launch_functional_tests
\ No newline at end of file