parent
388b031298
commit
66d5a30de7
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// @dart = 2.8
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_driver/flutter_driver.dart';
|
import 'package:flutter_driver/flutter_driver.dart';
|
||||||
@ -15,7 +14,7 @@ void main() {
|
|||||||
group('Hello World App', () {
|
group('Hello World App', () {
|
||||||
final SerializableFinder titleFinder = find.byValueKey('title');
|
final SerializableFinder titleFinder = find.byValueKey('title');
|
||||||
|
|
||||||
FlutterDriver driver;
|
late FlutterDriver driver;
|
||||||
|
|
||||||
// Connect to the Flutter driver before running any tests.
|
// Connect to the Flutter driver before running any tests.
|
||||||
setUpAll(() async {
|
setUpAll(() async {
|
||||||
|
@ -2,23 +2,19 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// 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:flutter_driver/flutter_driver.dart';
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('button tap test', () {
|
group('button tap test', () {
|
||||||
FlutterDriver driver;
|
late FlutterDriver driver;
|
||||||
|
|
||||||
setUpAll(() async {
|
setUpAll(() async {
|
||||||
driver = await FlutterDriver.connect();
|
driver = await FlutterDriver.connect();
|
||||||
});
|
});
|
||||||
|
|
||||||
tearDownAll(() async {
|
tearDownAll(() async {
|
||||||
if (driver != null)
|
driver.close();
|
||||||
driver.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('tap on the button, verify result', () async {
|
test('tap on the button, verify result', () async {
|
||||||
@ -30,7 +26,7 @@ void main() {
|
|||||||
await driver.waitFor(button);
|
await driver.waitFor(button);
|
||||||
await driver.tap(button);
|
await driver.tap(button);
|
||||||
|
|
||||||
String batteryLevel;
|
String? batteryLevel;
|
||||||
while (batteryLevel == null || batteryLevel.contains('unknown')) {
|
while (batteryLevel == null || batteryLevel.contains('unknown')) {
|
||||||
batteryLevel = await driver.getText(batteryLevelLabel);
|
batteryLevel = await driver.getText(batteryLevelLabel);
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,19 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// 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:flutter_driver/flutter_driver.dart';
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('button tap test', () {
|
group('button tap test', () {
|
||||||
FlutterDriver driver;
|
late FlutterDriver driver;
|
||||||
|
|
||||||
setUpAll(() async {
|
setUpAll(() async {
|
||||||
driver = await FlutterDriver.connect();
|
driver = await FlutterDriver.connect();
|
||||||
});
|
});
|
||||||
|
|
||||||
tearDownAll(() async {
|
tearDownAll(() async {
|
||||||
if (driver != null)
|
driver.close();
|
||||||
driver.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('tap on the button, verify result', () async {
|
test('tap on the button, verify result', () async {
|
||||||
@ -30,7 +26,7 @@ void main() {
|
|||||||
await driver.waitFor(button);
|
await driver.waitFor(button);
|
||||||
await driver.tap(button);
|
await driver.tap(button);
|
||||||
|
|
||||||
String batteryLevel;
|
String? batteryLevel;
|
||||||
while (batteryLevel == null || batteryLevel.contains('unknown')) {
|
while (batteryLevel == null || batteryLevel.contains('unknown')) {
|
||||||
batteryLevel = await driver.getText(batteryLevelLabel);
|
batteryLevel = await driver.getText(batteryLevelLabel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user