Skip to content

Commit df2c46d

Browse files
committed
feat(mobile): iOS simulator smoke test + ci-mobile integration job
1 parent 5869888 commit df2c46d

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

‎.github/workflows/ci-mobile.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,48 @@ jobs:
4747
- name: Test (app)
4848
working-directory: mobile
4949
run: flutter test
50+
51+
test-mobile-ios:
52+
name: Flutter integration tests (iOS simulator)
53+
runs-on: macos-latest
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: flutter-actions/setup-flutter@v3
59+
with:
60+
channel: stable
61+
62+
- name: Install dependencies (plugin)
63+
working-directory: packages/ferrostar_flutter
64+
run: flutter pub get
65+
66+
- name: Install dependencies (app)
67+
working-directory: mobile
68+
run: flutter pub get
69+
70+
- name: Boot iPhone 17 simulator
71+
run: |
72+
UDID=$(xcrun simctl list devices available --json \
73+
| python3 -c "
74+
import json,sys
75+
devs = json.load(sys.stdin)['devices']
76+
for runtime, devices in devs.items():
77+
for d in devices:
78+
if 'iPhone 17' in d['name'] and d['isAvailable']:
79+
print(d['udid']); exit()
80+
")
81+
xcrun simctl boot "$UDID"
82+
echo "SIM_UDID=$UDID" >> "$GITHUB_ENV"
83+
84+
- name: Enable Flutter SPM integration
85+
working-directory: mobile
86+
run: flutter config --enable-swift-package-manager
87+
88+
- name: Build (simulator, no codesign)
89+
working-directory: mobile
90+
run: flutter build ios --no-codesign --simulator
91+
92+
- name: Run integration smoke test
93+
working-directory: mobile
94+
run: flutter test integration_test/navigation_smoke_test.dart -d "$SIM_UDID"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_test/flutter_test.dart';
3+
import 'package:integration_test/integration_test.dart';
4+
import 'package:beebeebike/main.dart' as app;
5+
6+
void main() {
7+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
8+
9+
testWidgets('app launches and renders the map screen', (tester) async {
10+
app.main();
11+
await tester.pumpAndSettle(const Duration(seconds: 5));
12+
expect(find.byType(Scaffold), findsWidgets);
13+
});
14+
}

‎mobile/pubspec.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ dependencies:
2828
dev_dependencies:
2929
flutter_test:
3030
sdk: flutter
31+
integration_test:
32+
sdk: flutter
3133
flutter_lints: ^5.0.0
3234
build_runner: ^2.4.13
3335
freezed: ^2.5.7

0 commit comments

Comments
 (0)