Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
trying reviever suggestion for drive_example compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nturgut committed Feb 28, 2020
1 parent a5de564 commit 494c8d4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
23 changes: 2 additions & 21 deletions packages/e2e/example/test_driver/example_e2e.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,11 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:e2e/e2e.dart';

import 'package:e2e_example/main.dart' as app;
import 'example_e2e_io.dart' if (dart.library.html) 'example_e2e_web.dart' as tests;

void main() {
E2EWidgetsFlutterBinding.ensureInitialized();
testWidgets('verify text', (WidgetTester tester) async {
// Build our app and trigger a frame.
app.main();

// Trigger a frame.
await tester.pumpAndSettle();

// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Platform: ${Platform.operatingSystem}'),
),
findsOneWidget,
);
});
tests.main();
}
34 changes: 34 additions & 0 deletions packages/e2e/example/test_driver/example_e2e_io.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:e2e/e2e.dart';

import 'package:e2e_example/main.dart' as app;

void main() {
E2EWidgetsFlutterBinding.ensureInitialized();
testWidgets('verify text', (WidgetTester tester) async {
// Build our app and trigger a frame.
app.main();

// Trigger a frame.
await tester.pumpAndSettle();

// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Platform: ${Platform.operatingSystem}'),
),
findsOneWidget,
);
});
}
2 changes: 0 additions & 2 deletions packages/e2e/example/test_driver/example_e2e_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

@TestOn('browser')

import 'dart:html' as html;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
3 changes: 0 additions & 3 deletions packages/e2e/example/test_driver/example_e2e_web_test.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
@TestOn('browser')

import 'dart:async';
import 'dart:io';

import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';

Future<void> main() async {
final FlutterDriver driver = await FlutterDriver.connect();
Expand Down

0 comments on commit 494c8d4

Please sign in to comment.