Skip to content

Commit dc862fc

Browse files
committed
chore: Adding integration testing chrome driver. #1
1 parent bdc7181 commit dc862fc

File tree

2 files changed

+6
-51
lines changed

2 files changed

+6
-51
lines changed

integration_test/widget_test.dart

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,7 @@ import 'widget_test.mocks.dart';
2424

2525
@GenerateMocks([PlatformService])
2626
void main() {
27-
testWidgets('Normal setup', (WidgetTester tester) async {
28-
final platformServiceMock = MockPlatformService();
29-
// Platform is mobile
30-
when(platformServiceMock.isWebPlatform()).thenAnswer((_) => false);
31-
32-
// Build our app and trigger a frame.
33-
await tester.pumpWidget(
34-
App(
35-
platformService: platformServiceMock,
36-
),
37-
);
38-
await tester.pumpAndSettle();
39-
40-
// Expect to find the normal page setup
41-
expect(find.text('Flutter Quill'), findsOneWidget);
42-
43-
// Enter 'hi' into Quill Editor.
44-
await tester.tap(find.byType(QuillEditor));
45-
await tester.quillEnterText(find.byType(QuillEditor), 'hi\n');
46-
await tester.pumpAndSettle();
47-
});
48-
49-
testWidgets('Select image', (WidgetTester tester) async {
50-
final platformServiceMock = MockPlatformService();
51-
52-
// Platform is mobile
53-
when(platformServiceMock.isWebPlatform()).thenAnswer((_) => false);
54-
55-
// Build our app and trigger a frame.
56-
await tester.pumpWidget(
57-
App(
58-
platformService: platformServiceMock,
59-
),
60-
);
61-
await tester.pumpAndSettle();
62-
63-
// Expect to find the normal page setup
64-
expect(find.text('Flutter Quill'), findsOneWidget);
65-
66-
// Enter 'hi' into Quill Editor.
67-
await tester.tap(find.byType(QuillEditor));
68-
await tester.quillEnterText(find.byType(QuillEditor), 'hi\n');
69-
await tester.pumpAndSettle();
70-
71-
final imageButton = find.byType(ImageButton);
72-
await tester.tap(imageButton);
73-
await tester.pumpAndSettle();
74-
75-
//TODO add image picker
76-
//https://github.com/dwyl/flutter-image-upload-demo/blob/main/test/widget_test.dart
77-
});
27+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
7828

7929
testWidgets('Normal setup (web version)', (WidgetTester tester) async {
8030
tester.view.physicalSize = const Size(400, 600);

test_driver/integration_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// Check this link for context: https://docs.flutter.dev/testing/integration-tests#running-in-a-browser
2+
3+
import 'package:integration_test/integration_test_driver.dart';
4+
5+
Future<void> main() => integrationDriver();

0 commit comments

Comments
 (0)