diff --git a/.cirrus.yml b/.cirrus.yml index 44244174..fa60f7f8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,64 +1,37 @@ -#task: -# env: -# EMULATOR_API_LEVEL: 30 -# ABI: "google_apis;x86" -# # Xcode 12 task -# osx_instance: -# image: big-sur-xcode-12.4 -# install_node_script: -# - brew install node -# - cd ./nodejs_server_test_auth_basic_and_ssl -# - npm install -# upgrade_script: -# - sudo gem install cocoapods -# #- flutter channel stable -# #- flutter upgrade -# #- flutter channel beta -# #- flutter upgrade -# #- flutter channel dev -# #- flutter upgrade -## - flutter channel master -## - flutter upgrade -## - git fetch origin master -# matrix: -## - name: test_plugin_ios -## env: -## matrix: -## CHANNEL: "master" -## #CHANNEL: "dev" -## #CHANNEL: "beta" -## #CHANNEL: "stable" -## script: -## - xcrun simctl list -## - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-4 | xargs xcrun simctl boot -## - flutter channel $CHANNEL -## - ./scripts/test.sh $(ipconfig getifaddr en0) -# - name: test_plugin_android -# env: -# matrix: -# CHANNEL: "master" -# #CHANNEL: "dev" -# #CHANNEL: "beta" -# #CHANNEL: "stable" -# install_images_script: -# - mkdir -p .android && touch ~/.android/repositories.cfg -# #- sdkmanager --list -# - sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ABI" -# - (yes || true) | sdkmanager --licenses -# create_device_script: -# echo no | avdmanager create avd --force -n test -k "system-images;android-$EMULATOR_API_LEVEL;$ABI" -# start_emulator_background_script: -# $ANDROID_SDK_ROOT/emulator/emulator -verbose -avd test -no-audio -no-window -# pub_cache: -# folder: ~/.pub-cache -# wait_for_emulator_script: -# #- adb wait-for-device -# - ./scripts/android-wait-for-emulator.sh -# #- adb shell input keyevent 82 -# flutter_change_channel_script: flutter channel $CHANNEL -# doctor_script: flutter doctor -v -# devices_script: flutter devices -# script: ./scripts/test.sh $(ipconfig getifaddr en0) +task: + # Xcode 12 task + osx_instance: + image: big-sur-xcode-12.4 + install_node_script: + - brew install node + - cd ./nodejs_server_test_auth_basic_and_ssl + - npm install + upgrade_script: + - sudo gem install cocoapods + #- flutter channel stable + #- flutter upgrade + #- flutter channel beta + #- flutter upgrade + #- flutter channel dev + #- flutter upgrade + - flutter channel master + - flutter upgrade + - git fetch origin master + matrix: + - name: test_plugin_ios + env: + matrix: + CHANNEL: "master" + #CHANNEL: "dev" + #CHANNEL: "beta" + #CHANNEL: "stable" + test_script: + - xcrun simctl list + - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-4 | xargs xcrun simctl boot + - flutter channel $CHANNEL + - ./scripts/test.sh $(ipconfig getifaddr en0) + pub_cache: + folder: ~/.pub-cache task: env: @@ -67,8 +40,8 @@ task: ABI: "x86" container: image: cirrusci/flutter:latest - cpu: 4 - memory: 10G + cpu: 6 + memory: 12G kvm: true install_node_script: - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash @@ -122,6 +95,6 @@ task: - export NVM_DIR="$HOME/.nvm" - source "$NVM_DIR/nvm.sh" # This loads nvm - nvm use node - - ./scripts/test.sh $(ipconfig getifaddr en0) + - ./scripts/test.sh $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') pub_cache: folder: ~/.pub-cache diff --git a/.travis.yml b/.travis.yml index 17bdd209..e9b9af11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,84 @@ language: dart -install: - - export HOMEBREW_NO_AUTO_UPDATE=1 - - brew install node - - brew install libimobiledevice ideviceinstaller ios-deploy - - brew install cocoapods || echo 'ignore exit(1)' - - brew link --overwrite cocoapods - - export FLUTTER_HOME=$HOME/flutter - - export PATH=$HOME/flutter:$HOME/flutter/bin/:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH - - git clone https://github.com/flutter/flutter.git $FLUTTER_HOME - - cd $FLUTTER_HOME - - git checkout beta - - git checkout stable - - flutter doctor - - flutter channel master - - flutter upgrade - - flutter doctor - - cd $TRAVIS_BUILD_DIR - jobs: include: - stage: iOS Integration Tests os: osx osx_image: xcode12.3 - before_script: + install: + - export HOMEBREW_NO_AUTO_UPDATE=1 + - brew install node + - brew install libimobiledevice ideviceinstaller ios-deploy + - brew install cocoapods || echo 'ignore exit(1)' + - brew link --overwrite cocoapods + - export FLUTTER_HOME=$HOME/flutter + - export PATH=$HOME/flutter:$HOME/flutter/bin/:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH + - git clone https://github.com/flutter/flutter.git $FLUTTER_HOME + - cd $FLUTTER_HOME + - git checkout beta + - git checkout stable + - flutter doctor + - flutter channel master + - flutter upgrade + - flutter doctor - cd $TRAVIS_BUILD_DIR/nodejs_server_test_auth_basic_and_ssl - npm install - cd $TRAVIS_BUILD_DIR + before_script: - xcrun simctl list - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot script: - - ./scripts/test.sh $(ipconfig getifaddr en0) \ No newline at end of file + - ./scripts/test.sh $(ipconfig getifaddr en0) + cache: + directories: + - $HOME/.pub-cache + + include: + - stage: Android Integration Tests + language: android + dist: trusty + android: + components: + - tools + - platform-tools + - build-tools-30.0.0 + - android-30 + - sys-img-x86-android-30 + licenses: + - 'android-sdk-preview-license-52d11cd2' + - 'android-sdk-license-.+' + - 'google-gdk-license-.+' + before_install: + - yes | sdkmanager "platforms;android-30" + - echo no | avdmanager --verbose create avd --force -n test -k "system-images;android-30;google_apis;x86" + - emulator -avd test -verbose -no-window -no-audio & + - ./scripts/android-wait-for-emulator.sh + install: + - export FLUTTER_HOME=$HOME/flutter + - export PATH=$HOME/flutter:$HOME/flutter/bin/:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH + - git clone https://github.com/flutter/flutter.git $FLUTTER_HOME + - cd $FLUTTER_HOME + - git checkout beta + - git checkout stable + - flutter doctor + - flutter channel master + - flutter upgrade + - flutter doctor + - cd $TRAVIS_BUILD_DIR + - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash + - export NVM_DIR="$HOME/.nvm" + - source "$NVM_DIR/nvm.sh" # This loads nvm + - nvm install node + - nvm use node + - cd $TRAVIS_BUILD_DIR/nodejs_server_test_auth_basic_and_ssl + - npm install + - cd $TRAVIS_BUILD_DIR + script: + - export PATH="$PATH":"$HOME/.pub-cache/bin" + - export NVM_DIR="$HOME/.nvm" + - source "$NVM_DIR/nvm.sh" # This loads nvm + - nvm use node + - ./scripts/test.sh $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') + cache: + directories: + - $HOME/.pub-cache \ No newline at end of file diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index fbf2b79c..bb75c82b 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["device_info"]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-02-10 15:00:44.003747","version":"1.26.0-18.0.pre.257"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["device_info"]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-02-10 15:36:56.627116","version":"1.26.0-18.0.pre.257"} \ No newline at end of file diff --git a/example/integration_test/webview_flutter_test.dart b/example/integration_test/webview_flutter_test.dart index 4c4f9746..1c05e654 100644 --- a/example/integration_test/webview_flutter_test.dart +++ b/example/integration_test/webview_flutter_test.dart @@ -684,7 +684,7 @@ void main() { const int Y_SCROLL = 321; await controller.scrollTo(x: X_SCROLL, y: Y_SCROLL); - await tester.pumpAndSettle(Duration(seconds: 1)); + await tester.pumpAndSettle(Duration(seconds: 2)); int scrollPosX = await controller.getScrollX(); int scrollPosY = await controller.getScrollY(); expect(scrollPosX, X_SCROLL); @@ -692,7 +692,7 @@ void main() { // Check scrollBy() (on top of scrollTo()) await controller.scrollBy(x: X_SCROLL, y: Y_SCROLL); - await tester.pumpAndSettle(Duration(seconds: 1)); + await tester.pumpAndSettle(Duration(seconds: 2)); scrollPosX = await controller.getScrollX(); scrollPosY = await controller.getScrollY(); expect(scrollPosX, X_SCROLL * 2); @@ -761,7 +761,7 @@ void main() { const int Y_SCROLL = 321; await controller.scrollTo(x: X_SCROLL, y: Y_SCROLL); - await tester.pumpAndSettle(Duration(seconds: 1)); + await tester.pumpAndSettle(Duration(seconds: 2)); int scrollPosX = await controller.getScrollX(); int scrollPosY = await controller.getScrollY(); expect(scrollPosX, X_SCROLL); @@ -769,7 +769,7 @@ void main() { // Check scrollBy() (on top of scrollTo()) await controller.scrollBy(x: X_SCROLL, y: Y_SCROLL); - await tester.pumpAndSettle(Duration(seconds: 1)); + await tester.pumpAndSettle(Duration(seconds: 2)); scrollPosX = await controller.getScrollX(); scrollPosY = await controller.getScrollY(); expect(scrollPosX, X_SCROLL * 2); diff --git a/scripts/test.sh b/scripts/test.sh index 16d9476e..cd56c3d0 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -7,7 +7,8 @@ function error() { echo "$@" 1>&2 } -# on linux/macOS local IP can be found using $(ipconfig getifaddr en0) +# on macOS local IP can be found using $(ipconfig getifaddr en0) +# on linux local IP can be found using $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') export NODE_SERVER_IP=$1 FAILED=0