This repository was archived by the owner on May 7, 2026. It is now read-only.
forked from pichillilorenzo/flutter_inappwebview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·62 lines (48 loc) · 1.75 KB
/
test.sh
File metadata and controls
executable file
·62 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
readonly SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
readonly PROJECT_DIR="$(dirname $SCRIPT_PATH)"
function error() {
echo "$@" 1>&2
}
# 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}')
export NODE_SERVER_IP=$1
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
DEVICE_ID=$2
FAILED=0
if [ ! -z "$2" ] && [ $DEVICE_ID = "chrome" ]; then
$PROJECT_DIR/tool/chromedriver --port=4444 &
fi
dart $PROJECT_DIR/tool/env.dart
cd $PROJECT_DIR/test_node_server
node index.js &
# 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
flutter --version
flutter devices
flutter clean
flutter pub get
cd $PROJECT_DIR/flutter_inappwebview/example
flutter clean
if [ ! -z "$2" ]; then
flutter driver --driver=test_driver/integration_test.dart --target=integration_test/webview_flutter_test.dart --device-id=$DEVICE_ID
else
flutter driver --driver=test_driver/integration_test.dart --target=integration_test/webview_flutter_test.dart
fi
if [ $? -eq 0 ]; then
echo "Integration tests passed successfully."
else
error "Some integration tests failed."
FAILED=1
fi
jobs -p | xargs kill
exit $FAILED