Revert "Migrate driver tests in example/ to NNBD (#75022)" (#75161)

This reverts commit 50a8ecb7d6.
This commit is contained in:
Jenn Magder
2021-02-01 11:45:07 -08:00
committed by GitHub
parent 00aa144202
commit 6bd54753d7
3 changed files with 16 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:async';
import 'package:flutter_driver/flutter_driver.dart';
@@ -14,7 +15,7 @@ void main() {
group('Hello World App', () {
final SerializableFinder titleFinder = find.byValueKey('title');
late FlutterDriver driver;
FlutterDriver driver;
// Connect to the Flutter driver before running any tests.
setUpAll(() async {

View File

@@ -2,19 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(goderbauer): migrate this file to null-safety when flutter_driver is null-safe.
// @dart = 2.9
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() {
group('button tap test', () {
late FlutterDriver driver;
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() async {
driver.close();
if (driver != null)
driver.close();
});
test('tap on the button, verify result', () async {
@@ -26,7 +30,7 @@ void main() {
await driver.waitFor(button);
await driver.tap(button);
String? batteryLevel;
String batteryLevel;
while (batteryLevel == null || batteryLevel.contains('unknown')) {
batteryLevel = await driver.getText(batteryLevelLabel);
}

View File

@@ -2,19 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(goderbauer): migrate this file to null-safety when flutter_driver is null-safe.
// @dart = 2.9
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() {
group('button tap test', () {
late FlutterDriver driver;
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() async {
driver.close();
if (driver != null)
driver.close();
});
test('tap on the button, verify result', () async {
@@ -26,7 +30,7 @@ void main() {
await driver.waitFor(button);
await driver.tap(button);
String? batteryLevel;
String batteryLevel;
while (batteryLevel == null || batteryLevel.contains('unknown')) {
batteryLevel = await driver.getText(batteryLevelLabel);
}