remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide-e2e/src/select_tests.sh

60 lines
1.7 KiB

3 years ago
#!/bin/bash
# Bash Menu Script Example
3 years ago
PS3='Select a browser: '
2 years ago
BROWSERS=( "chrome" "chrome headless" "firefox" "exit" )
3 years ago
select opt in "${BROWSERS[@]}"
do
case $opt in
"chrome")
echo "Chrome selected"
BROWSER="chromeDesktop"
break
;;
2 years ago
"chrome headless")
echo "Chrome headless selected"
BROWSER="chrome"
break
;;
3 years ago
"firefox")
echo "Firefox selected"
BROWSER="firefoxDesktop"
break
;;
"exit")
echo "Exiting"
exit 0
;;
*) echo "invalid option $REPLY";;
esac
done
3 years ago
yarn run build:e2e
3 years ago
PS3='Select a test or command: '
2 years ago
TESTFILES=( $(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | sort ) )
3 years ago
3 years ago
# declare -p TESTFILES
3 years ago
TESTFILES+=("list")
TESTFILES+=("exit")
select opt in "${TESTFILES[@]}"
do
if [ "$opt" = "exit" ]; then
break
fi
if [ "$opt" = "list" ]; then
for i in "${!TESTFILES[@]}"; do
printf "%s) %s\n" "$((i+1))" "${TESTFILES[$i]}"
done
else
# run the selected test
7 months ago
if [ "$BROWSER" = "firefoxDesktop" ]; then
yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch-firefox.js $opt --env=$BROWSER
elif [ "$BROWSER" = "chrome" ]; then
yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch-chrome.js $opt --env=$BROWSER
elif [ "$BROWSER" = "chromeDesktop" ]; then
yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch-chrome.js $opt --env=$BROWSER
fi
3 years ago
fi
3 years ago
done