Add tests for integration tests to devicelab (#79258)
This commit is contained in:
12
dev/devicelab/bin/tasks/integration_test_test.dart
Normal file
12
dev/devicelab/bin/tasks/integration_test_test.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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(createEndToEndIntegrationTest());
|
||||
}
|
||||
12
dev/devicelab/bin/tasks/integration_test_test_ios.dart
Normal file
12
dev/devicelab/bin/tasks/integration_test_test_ios.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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(createEndToEndIntegrationTest());
|
||||
}
|
||||
@@ -124,6 +124,13 @@ TaskFunction dartDefinesTask() {
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndIntegrationTest() {
|
||||
return IntegrationTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'integration_test/integration_test.dart',
|
||||
);
|
||||
}
|
||||
|
||||
class DriverTest {
|
||||
DriverTest(
|
||||
this.testDirectory,
|
||||
@@ -162,3 +169,29 @@ class DriverTest {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class IntegrationTest {
|
||||
IntegrationTest(this.testDirectory, this.testTarget);
|
||||
|
||||
final String testDirectory;
|
||||
final String testTarget;
|
||||
|
||||
Future<TaskResult> call() {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
final List<String> options = <String>[
|
||||
'-v',
|
||||
'-d',
|
||||
deviceId,
|
||||
testTarget,
|
||||
];
|
||||
await flutter('test', options: options);
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user