Skip to content

Commit 7d2daf6

Browse files
fix: dart format
1 parent efb1d16 commit 7d2daf6

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

example/integration_test/bug_reporting_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ void main() {
207207

208208
await wait(second: 4);
209209

210-
await $.native2.tap(NativeSelector(
211-
android: AndroidSelector(text: 'Cancel'),
212-
ios: IOSSelector(label: 'Cancel'),
213-
));
210+
await tapNativeView($,
211+
nativeView: NativeSelector(
212+
android: AndroidSelector(text: 'Cancel'),
213+
ios: IOSSelector(label: 'Cancel'),
214+
));
214215

215216
await wait(second: 4);
216217

217-
final callbackWidget = await $(
218-
'onDismiss callback called with DismissType.cancel and ReportType.other')
218+
final callbackWidget = await $(#dismiss_callback_dialog_test)
219219
.waitUntilVisible(timeout: const Duration(seconds: 5));
220220
expect(callbackWidget, findsOneWidget);
221221
});

example/integration_test/instabug_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ void main() {
1616
await $('Change Primary Color').scrollTo().tap();
1717

1818
await wait(second: 1);
19+
1920
final floatingButton = await getFAB($);
20-
bool isAndroid = defaultTargetPlatform == TargetPlatform.android;
2121

22-
if (isAndroid) {
23-
var s = floatingButton.androidViews.first.props;
24-
$.log(s.toString());
25-
}
22+
expect(
23+
isAndroid
24+
? floatingButton.androidViews.length
25+
: floatingButton.iosViews.length,
26+
equals(1));
2627
},
2728
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.fullyLive,
2829
);

example/integration_test/utils/utils.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Future<void> init(PatrolIntegrationTester $) async {
1414

1515
await $.pumpWidgetAndSettle(const MyApp());
1616
await $.native2.initialize();
17+
18+
await wait(second: 2);
1719
}
1820

1921
Future<void> wait({int? second, int? miliSeconds}) {
@@ -30,11 +32,23 @@ Future<GetNativeViewsResult> getNativeView(PatrolIntegrationTester $,
3032
android: AndroidSelector(
3133
resourceName: 'com.instabug.flutter.example:id/${android}'));
3234
if (waitUntilVisible) {
33-
await $.native2.waitUntilVisible(nativeView, timeout: Duration(seconds: 8));
35+
await $.native2
36+
.waitUntilVisible(nativeView, timeout: const Duration(seconds: 8));
3437
}
38+
3539
return await $.native2.getNativeViews(nativeView);
3640
}
3741

42+
Future<void> tapNativeView(PatrolIntegrationTester $,
43+
{required NativeSelector nativeView, bool waitUntilVisible = true}) async {
44+
if (waitUntilVisible) {
45+
await $.native2
46+
.waitUntilVisible(nativeView, timeout: const Duration(seconds: 8));
47+
}
48+
49+
await $.native2.tap(nativeView);
50+
}
51+
3852
Future<GetNativeViewsResult> getFAB(PatrolIntegrationTester $,
3953
{bool waitUntilVisible = true}) {
4054
return getNativeView($,

example/lib/src/screens/my_home_page.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class _MyHomePageState extends State<MyHomePage> {
4343
return AlertDialog(
4444
title: const Text('On Dismiss'),
4545
content: Text(
46-
'onDismiss callback called with $dismissType and $reportType',
47-
),
46+
'onDismiss callback called with $dismissType and $reportType',
47+
key: const ValueKey('dismiss_callback_dialog_test')),
4848
);
4949
},
5050
);
@@ -239,7 +239,7 @@ class _MyHomePageState extends State<MyHomePage> {
239239
const SectionTitle('Repro Steps'),
240240
InstabugTextField(
241241
controller: screenNameController,
242-
textFieldKey: ValueKey('screen_name_input'),
242+
textFieldKey: const ValueKey('screen_name_input'),
243243
label: 'Enter screen name',
244244
),
245245
InstabugButton(
@@ -336,7 +336,7 @@ class _MyHomePageState extends State<MyHomePage> {
336336
),
337337
],
338338
),
339-
SectionTitle('FeatureFlags'),
339+
const SectionTitle('FeatureFlags'),
340340
InstabugTextField(
341341
controller: featureFlagsController,
342342
label: 'Feature Flag name',

0 commit comments

Comments
 (0)