2019-11-25 00:42:27 +00:00
#!/bin/bash
2021-01-28 16:10:15 +00:00
2021-02-10 11:49:34 +00:00
readonly SCRIPT_PATH = " $( cd " $( dirname " $0 " ) " >/dev/null 2>& 1 ; pwd -P ) "
readonly PROJECT_DIR = " $( dirname $SCRIPT_PATH ) "
2021-02-10 03:14:58 +00:00
function error( ) {
echo " $@ " 1>& 2
}
2022-04-18 00:59:46 +00:00
# on macOS local IP can be found using something like $(ipconfig getifaddr en0)
# on linux local IP can be found using something like $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') or $(ip route get 1 | awk '{print $NF;exit}')
2019-11-25 00:42:27 +00:00
export NODE_SERVER_IP = $1
2022-04-29 00:07:01 +00:00
if [ -z " $1 " ] ; then
export NODE_SERVER_IP = $( ipconfig getifaddr en0)
fi
echo Node Server IP: $NODE_SERVER_IP
if [ -z " $NODE_SERVER_IP " ] ; then
echo No Server IP found
jobs -p | xargs kill
exit 1
fi
2023-11-11 16:32:59 +00:00
DEVICE_ID = $2
2021-02-10 03:14:58 +00:00
FAILED = 0
2023-11-11 16:32:59 +00:00
if [ ! -z " $2 " ] && [ $DEVICE_ID = "chrome" ] ; then
2022-04-27 14:59:49 +00:00
$PROJECT_DIR /tool/chromedriver --port= 4444 &
fi
2021-02-10 11:49:34 +00:00
dart $PROJECT_DIR /tool/env.dart
2021-02-10 03:14:58 +00:00
2022-05-02 10:52:10 +00:00
cd $PROJECT_DIR /test_node_server
2019-11-25 00:42:27 +00:00
node index.js &
2021-02-10 03:14:58 +00:00
2022-10-25 09:18:53 +00:00
# Only for Android
# Open Chrome on the development device, navigate to chrome://flags, search for an item called Enable command line on non-rooted devices and change it to ENABLED and then restart the browser.
adb shell "echo '_ --disable-digital-asset-link-verification-for-url=\"https://flutter.dev\"' > /data/local/tmp/chrome-command-line" || true
2022-04-18 00:59:46 +00:00
flutter --version
2023-11-11 16:32:59 +00:00
flutter devices
2020-05-11 00:48:41 +00:00
flutter clean
2022-05-04 00:17:33 +00:00
flutter pub get
2023-11-28 01:37:48 +00:00
cd $PROJECT_DIR /flutter_inappwebview/example
2020-05-09 02:36:07 +00:00
flutter clean
2023-11-11 16:32:59 +00:00
if [ ! -z " $2 " ] ; then
flutter driver --driver= test_driver/integration_test.dart --target= integration_test/webview_flutter_test.dart --device-id= $DEVICE_ID
2022-04-27 14:59:49 +00:00
else
flutter driver --driver= test_driver/integration_test.dart --target= integration_test/webview_flutter_test.dart
fi
2021-02-10 03:14:58 +00:00
if [ $? -eq 0 ] ; then
echo "Integration tests passed successfully."
else
error "Some integration tests failed."
FAILED = 1
fi
2022-04-27 15:50:30 +00:00
jobs -p | xargs kill
2021-02-10 03:14:58 +00:00
exit $FAILED