Add tests for integration tests to devicelab (#79258)
This commit is contained in:
parent
9bbe89d8e7
commit
8158b478d7
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
// 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_test/flutter_test.dart';
|
||||
import 'package:integration_ui/build_mode.dart' as app;
|
||||
|
||||
void main() {
|
||||
group('Integration Test', () {
|
||||
testWidgets('smoke test', (WidgetTester tester) async {
|
||||
app.main();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Hello, world!'), findsOneWidget);
|
||||
});
|
||||
});
|
||||
}
|
@ -13,6 +13,8 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_driver:
|
||||
sdk: flutter
|
||||
integration_test:
|
||||
sdk: flutter
|
||||
test: 1.16.5
|
||||
|
||||
_fe_analyzer_shared: 19.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -726,6 +726,12 @@
|
||||
"task_name": "mac_android_integration_ui_textfield",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Mac_android integration_test_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "mac_android_integration_test_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Mac_android microbenchmarks",
|
||||
"repo": "flutter",
|
||||
@ -1062,6 +1068,12 @@
|
||||
"task_name": "mac_ios_integration_ui_ios_textfield",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Mac_ios integration_test_test_ios",
|
||||
"repo": "flutter",
|
||||
"task_name": "mac_ios_integration_test_test_ios",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Mac_ios ios_app_with_extensions_test",
|
||||
"repo": "flutter",
|
||||
|
Loading…
x
Reference in New Issue
Block a user