Showing
4 changed files
with
35 additions
and
2 deletions
| @@ -47,9 +47,12 @@ jobs: | @@ -47,9 +47,12 @@ jobs: | ||
| 47 | - flutter doctor -v | 47 | - flutter doctor -v |
| 48 | 48 | ||
| 49 | # Wait for emulator to finish startup. | 49 | # Wait for emulator to finish startup. |
| 50 | - - ./script/android-wait-for-emulator.sh | 50 | + - ./ci/wait.sh |
| 51 | - adb shell input keyevent 82 | 51 | - adb shell input keyevent 82 |
| 52 | - flutter devices | 52 | - flutter devices |
| 53 | + | ||
| 54 | + # cd to example | ||
| 55 | + - cd example | ||
| 53 | script: travis_retry flutter driver test_driver/app.dart | 56 | script: travis_retry flutter driver test_driver/app.dart |
| 54 | - <<: *integration-test-stage | 57 | - <<: *integration-test-stage |
| 55 | os: osx | 58 | os: osx |
| @@ -72,4 +75,7 @@ jobs: | @@ -72,4 +75,7 @@ jobs: | ||
| 72 | - export PATH="$PATH":"$HOME/.pub-cache/bin" | 75 | - export PATH="$PATH":"$HOME/.pub-cache/bin" |
| 73 | - export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH | 76 | - export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH |
| 74 | - flutter doctor -v | 77 | - flutter doctor -v |
| 78 | + | ||
| 79 | + # cd to example | ||
| 80 | + - cd example | ||
| 75 | script: travis_retry flutter driver test_driver/main.dart | 81 | script: travis_retry flutter driver test_driver/main.dart |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | * Added integration testing. | 3 | * Added integration testing. |
| 4 | * Removed unnecessary Android Manifest permission. | 4 | * Removed unnecessary Android Manifest permission. |
| 5 | * Added a contributing guide. | 5 | * Added a contributing guide. |
| 6 | +* Added CI. | ||
| 6 | 7 | ||
| 7 | ## 0.1.2 | 8 | ## 0.1.2 |
| 8 | 9 |
| 1 | -# Wakelock [](https://pub.dev/packages/wakelock) | 1 | +# Wakelock [](https://pub.dev/packages/wakelock) [](https://travis-ci.com/creativecreatorormaybenot/wakelock) |
| 2 | 2 | ||
| 3 | This plugin allows you to enable and toggle the Android and iOS screen wakelock, which prevents the screen from turning off automatically. | 3 | This plugin allows you to enable and toggle the Android and iOS screen wakelock, which prevents the screen from turning off automatically. |
| 4 | Essentially, this allows you to keep the device awake, i.e. prevent the phone or tablet from sleeping. | 4 | Essentially, this allows you to keep the device awake, i.e. prevent the phone or tablet from sleeping. |
ci/wait.sh
0 → 100644
| 1 | +#!/bin/bash | ||
| 2 | + | ||
| 3 | +# Based on https://medium.com/@nocnoc/flutter-unit-widget-and-integration-testing-with-ios-and-android-emulators-on-travis-ci-df17ed7c3be | ||
| 4 | +# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain | ||
| 5 | + | ||
| 6 | +set +e | ||
| 7 | + | ||
| 8 | +bootanim="" | ||
| 9 | +failcounter=0 | ||
| 10 | +timeout_in_sec=360 | ||
| 11 | + | ||
| 12 | +until [[ "$bootanim" =~ "stopped" ]]; do | ||
| 13 | + bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &` | ||
| 14 | + if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" | ||
| 15 | + || "$bootanim" =~ "running" ]]; then | ||
| 16 | + let "failcounter += 1" | ||
| 17 | + echo "Waiting for emulator to start" | ||
| 18 | + if [[ $failcounter -gt timeout_in_sec ]]; then | ||
| 19 | + echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" | ||
| 20 | + exit 1 | ||
| 21 | + fi | ||
| 22 | + fi | ||
| 23 | + sleep 1 | ||
| 24 | +done | ||
| 25 | + | ||
| 26 | +echo "Emulator is ready" |
-
Please register or login to post a comment