[devicelab] split end to end tests into driver targets (#68410)

Split the integration_ui target into individual driver tests. Remove disabled screenshot tests
This commit is contained in:
Jonah Williams
2020-10-19 12:28:13 -07:00
committed by GitHub
parent 8c03ff8c1d
commit 223df0c351
11 changed files with 123 additions and 64 deletions

View File

@@ -92,15 +92,6 @@ TaskFunction createAndroidSplashScreenKitchenSinkTest() {
);
}
/// Executes a driver test that takes a screenshot and compares it against a golden image.
/// The golden image is served by Flutter Gold (https://flutter-gold.skia.org/).
TaskFunction createFlutterDriverScreenshotTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/flutter_driver_screenshot_test',
'lib/main.dart',
);
}
TaskFunction createIOSPlatformViewTests() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ios_platform_view_tests',
@@ -108,6 +99,34 @@ TaskFunction createIOSPlatformViewTests() {
);
}
TaskFunction createEndToEndKeyboardTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui',
'lib/keyboard_resize.dart',
);
}
TaskFunction createEndToEndDriverTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui',
'lib/driver.dart',
);
}
TaskFunction createEndToEndScreenshotTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui',
'lib/screenshot.dart',
);
}
TaskFunction createEndToEndKeyboardTextfieldTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui',
'lib/keyboard_textfield.dart',
);
}
class DriverTest {
DriverTest(
this.testDirectory,

View File

@@ -1,32 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import '../framework/adb.dart';
import '../framework/task_result.dart';
import '../framework/utils.dart';
Future<TaskResult> runEndToEndTests() async {
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui');
await inDirectory<void>(testDirectory, () async {
await flutter('packages', options: <String>['get']);
const List<String> entryPoints = <String>[
'lib/keyboard_resize.dart',
'lib/driver.dart',
'lib/screenshot.dart',
'lib/keyboard_textfield.dart',
];
for (final String entryPoint in entryPoints) {
await flutter('drive', options: <String>['--verbose', '-d', deviceId, entryPoint]);
}
});
return TaskResult.success(<String, dynamic>{});
}