Add integration test for the Platform Services app (#8826)

This commit is contained in:
Sarah Zakarias
2017-03-20 22:19:03 +01:00
committed by GitHub
parent 142922deb4
commit d1f73fd0ad
8 changed files with 132 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
// Copyright 2017 The Chromium 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:async';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createPlatformServiceDriverTest());
}

View File

@@ -0,0 +1,14 @@
// Copyright 2017 The Chromium 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:async';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createPlatformServiceDriverTest());
}

View File

@@ -9,6 +9,14 @@ import '../framework/adb.dart';
import '../framework/framework.dart';
import '../framework/utils.dart';
TaskFunction createPlatformServiceDriverTest() {
return new DriverTest(
'${flutterDirectory.path}/examples/platform_services',
'test_driver/button_tap.dart',
);
}
TaskFunction createComplexLayoutScrollPerfTest() {
return new PerfTest(
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
@@ -152,6 +160,39 @@ class PerfTest {
}
}
class DriverTest {
DriverTest(this.testDirectory, this.testTarget);
final String testDirectory;
final String testTarget;
Future<TaskResult> call() {
return inDirectory(testDirectory, () async {
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('drive', options: <String>[
'-v',
'-t',
testTarget,
'-d',
deviceId,
]);
return new TaskResult.success(null);
});
}
}
class BuildTest {
BuildTest(this.testDirectory);

View File

@@ -83,6 +83,12 @@ tasks:
stage: devicelab
required_agent_capabilities: ["has-android-device"]
platform_services_test:
description: >
Runs a driver test on the Platform Services sample app on Android.
stage: devicelab
required_agent_capabilities: ["has-android-device"]
flutter_gallery__start_up:
description: >
Measures the startup time of the Flutter Gallery app on Android.
@@ -138,9 +144,14 @@ tasks:
stage: devicelab
required_agent_capabilities: ["has-android-device"]
# iOS on-device tests
platform_services_test_ios:
description: >
Runs a driver test on the Platform Services sample app on iOS.
stage: devicelab_ios
required_agent_capabilities: ["has-ios-device"]
complex_layout_scroll_perf_ios__timeline_summary:
description: >
Measures the runtime performance of the Complex Layout sample app on