Unverified Commit 223df0c3 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

Split the integration_ui target into individual driver tests. Remove disabled screenshot tests
parent 8c03ff8c
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// 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.
import 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/integration_tests.dart';
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.fuchsia; deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createFlutterDriverScreenshotTest()); await task(createEndToEndDriverTest());
} }
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// 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.
import 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/integration_tests.dart';
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios; deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createFlutterDriverScreenshotTest()); await task(createEndToEndDriverTest());
} }
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
// 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.
import 'package:flutter_devicelab/tasks/integration_ui.dart'; import 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
/// End to end tests for iOS.
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios; deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(runEndToEndTests); await task(createEndToEndKeyboardTest());
} }
// 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 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createEndToEndScreenshotTest());
}
// 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 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createEndToEndKeyboardTextfieldTest());
}
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
// 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.
import 'package:flutter_devicelab/tasks/integration_ui.dart'; import 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
/// End to end tests for Android.
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android; deviceOperatingSystem = DeviceOperatingSystem.android;
await task(runEndToEndTests); await task(createEndToEndKeyboardTest());
} }
// 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 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createEndToEndScreenshotTest());
}
// 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 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createEndToEndKeyboardTextfieldTest());
}
...@@ -92,19 +92,38 @@ TaskFunction createAndroidSplashScreenKitchenSinkTest() { ...@@ -92,19 +92,38 @@ TaskFunction createAndroidSplashScreenKitchenSinkTest() {
); );
} }
/// Executes a driver test that takes a screenshot and compares it against a golden image. TaskFunction createIOSPlatformViewTests() {
/// The golden image is served by Flutter Gold (https://flutter-gold.skia.org/).
TaskFunction createFlutterDriverScreenshotTest() {
return DriverTest( return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/flutter_driver_screenshot_test', '${flutterDirectory.path}/dev/integration_tests/ios_platform_view_tests',
'lib/main.dart', 'lib/main.dart',
); );
} }
TaskFunction createIOSPlatformViewTests() { TaskFunction createEndToEndKeyboardTest() {
return DriverTest( return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ios_platform_view_tests', '${flutterDirectory.path}/dev/integration_tests/ui',
'lib/main.dart', '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',
); );
} }
......
// 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>{});
}
...@@ -401,12 +401,30 @@ tasks: ...@@ -401,12 +401,30 @@ tasks:
stage: devicelab stage: devicelab
required_agent_capabilities: ["mac/android"] required_agent_capabilities: ["mac/android"]
integration_ui: integration_ui_driver:
description: > description: >
Runs end-to-end Flutter tests on Android. Runs end-to-end Flutter tests on Android.
stage: devicelab stage: devicelab
required_agent_capabilities: ["mac/android"] required_agent_capabilities: ["mac/android"]
integration_ui_keyboard_resize:
description: >
Runs end-to-end Flutter tests on Android.
stage: devicelab
required_agent_capabilities: [ "mac/android" ]
integration_ui_screenshot:
description: >
Runs end-to-end Flutter tests on Android.
stage: devicelab
required_agent_capabilities: [ "mac/android" ]
integration_ui_textfield:
description: >
Runs end-to-end Flutter tests on Android.
stage: devicelab
required_agent_capabilities: [ "mac/android" ]
commands_test: commands_test:
description: > description: >
Runs tests of flutter run commands. Runs tests of flutter run commands.
...@@ -608,7 +626,25 @@ tasks: ...@@ -608,7 +626,25 @@ tasks:
stage: devicelab_ios stage: devicelab_ios
required_agent_capabilities: ["mac/ios"] required_agent_capabilities: ["mac/ios"]
integration_ui_ios: integration_ui_ios_driver:
description: >
Runs end-to-end Flutter tests on iPhone 6.
stage: devicelab_ios
required_agent_capabilities: ["mac/ios"]
integration_ui_ios_keyboard_resize:
description: >
Runs end-to-end Flutter tests on iPhone 6.
stage: devicelab_ios
required_agent_capabilities: ["mac/ios"]
integration_ui_ios_screenshot:
description: >
Runs end-to-end Flutter tests on iPhone 6.
stage: devicelab_ios
required_agent_capabilities: ["mac/ios"]
integration_ui_ios_textfield:
description: > description: >
Runs end-to-end Flutter tests on iPhone 6. Runs end-to-end Flutter tests on iPhone 6.
stage: devicelab_ios stage: devicelab_ios
...@@ -899,16 +935,6 @@ tasks: ...@@ -899,16 +935,6 @@ tasks:
# required_agent_capabilities: ["linux/android"] # required_agent_capabilities: ["linux/android"]
# flaky: true # flaky: true
# TODO(cyanglaz): Enable this test when we know how to test gold in device labs
# Or completely remove this test to LUCI when LUCI supports physical iOS devices.
# flutter_driver_screenshot_test_ios:
# description: >
# Screenshot tests running on a specifc iPhone 6.
# The test makes sure that there is no regression while renderring an image with gl on iOS.
# stage: devicelab_ios
# required_agent_capabilities: ["mac/ios", "ios/gl-render-image"]
# flaky: true
flutter_gallery_v2_chrome_run_test: flutter_gallery_v2_chrome_run_test:
description: > description: >
Checks that the New Flutter Gallery runs successfully on Chrome. Checks that the New Flutter Gallery runs successfully on Chrome.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment