Skip to content

Commit 5355504

Browse files
test: add build for ios, introduce small delay for vm to catchup
1 parent e144a00 commit 5355504

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/code-integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,8 @@ jobs:
9090
os: iOS
9191
os_version: ">=18.1"
9292
model: "iPhone 15"
93+
- run: flutter pub get
94+
- run: flutter build ios --simulator --target=integration_test/app_test.dart
95+
working-directory: flutter_secure_storage/example
9396
- run: flutter test integration_test
9497
working-directory: flutter_secure_storage/example

flutter_secure_storage/example/integration_test/app_test.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ void main() {
7878
});
7979
}
8080

81+
Duration duration = const Duration(milliseconds: 300);
82+
8183
Future<HomePageObject> _setupHomePage(WidgetTester tester) async {
8284
await tester.pumpWidget(const MaterialApp(home: HomePage()));
83-
await tester.pumpAndSettle();
85+
await tester.pumpAndSettle(duration);
8486
final pageObject = HomePageObject(tester);
8587
await pageObject.deleteAll();
8688
return pageObject;
@@ -112,7 +114,7 @@ class HomePageObject {
112114
final textField = find.byKey(const Key('value_field'));
113115
expect(textField, findsOneWidget, reason: 'Value text field not found');
114116
await tester.enterText(textField, newValue);
115-
await tester.pumpAndSettle();
117+
await tester.pumpAndSettle(duration);
116118

117119
await _tap(find.byKey(const Key('save')));
118120
}
@@ -142,11 +144,11 @@ class HomePageObject {
142144
final textField = find.byKey(const Key('key_field'));
143145
expect(textField, findsOneWidget);
144146
await tester.enterText(textField, keyWidget.data!);
145-
await tester.pumpAndSettle();
147+
await tester.pumpAndSettle(duration);
146148

147149
// Confirm the action
148150
await tester.tap(find.text('OK'));
149-
await tester.pumpAndSettle();
151+
await tester.pumpAndSettle(duration);
150152

151153
// Verify the SnackBar message
152154
final expectedText = 'Contains Key: $expectedResult';
@@ -168,11 +170,11 @@ class HomePageObject {
168170
final textField = find.byKey(const Key('key_field'));
169171
expect(textField, findsOneWidget);
170172
await tester.enterText(textField, keyWidget.data!);
171-
await tester.pumpAndSettle();
173+
await tester.pumpAndSettle(duration);
172174

173175
// Confirm the action
174176
await tester.tap(find.text('OK'));
175-
await tester.pumpAndSettle();
177+
await tester.pumpAndSettle(duration);
176178

177179
// Verify the SnackBar message
178180
expect(find.text('value: $expectedValue'), findsOneWidget);
@@ -213,6 +215,6 @@ class HomePageObject {
213215
reason: 'Widget not found for tapping: $finder',
214216
);
215217
await tester.tap(finder);
216-
await tester.pumpAndSettle();
218+
await tester.pumpAndSettle(duration);
217219
}
218220
}

0 commit comments

Comments
 (0)