Skip to content

Commit

Permalink
grant-permission-on-android-test (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
natsuk4ze authored Jul 28, 2023
1 parent 6e879f9 commit 01aeae1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot for caching."

# See: https://github.com/ReactiveCircus/android-emulator-runner
- name: Run integration tests
id: Run-integration-tests
continue-on-error: true
Expand All @@ -163,7 +162,9 @@ jobs:
emulator-boot-timeout: 900
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: flutter test integration_test/integration_test.dart --timeout none
script: |
if [ ${{ matrix.api-level }} -le 29 ]; then flutter build apk --debug; adb install -r build/app/outputs/flutter-apk/app-debug.apk; adb shell pm grant studio.midoridesign.gal_example android.permission.WRITE_EXTERNAL_STORAGE; fi
flutter test integration_test/integration_test.dart --timeout none
- name: Retry integration tests
if: steps.Run-integration-tests.outcome == 'failure'
Expand All @@ -178,6 +179,7 @@ jobs:
script: |
flutter clean
flutter pub get
if [ ${{ matrix.api-level }} -le 29 ]; then flutter build apk --debug; adb install -r build/app/outputs/flutter-apk/app-debug.apk; adb shell pm grant studio.midoridesign.gal_example android.permission.WRITE_EXTERNAL_STORAGE; fi
flutter test integration_test/integration_test.dart --timeout none
pre-emulator-launch-script: |
adb kill-server
Expand Down
8 changes: 8 additions & 0 deletions example/integration_test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ void main() {
expect(tester.takeException(), isNull);
});

testWidgets('requestAccess()', (tester) async {
app.main();
await tester.pumpAndSettle();
final button = find.byIcon(Icons.privacy_tip_outlined);
await tester.tap(button);
expect(tester.takeException(), isNull);
});

testWidgets('putVideo()', (tester) async {
app.main();
await tester.pumpAndSettle();
Expand Down

0 comments on commit 01aeae1

Please sign in to comment.