flutter/dev/devicelab/lib/tasks/integration_ui.dart
Chris Bracken 2d437f51c3 Add end-to-end test to verify resize on keyboard dismissal (#10005)
Adds an initial integration test that:
1. captures laid-out widget size
2. focuses a text field to show the keyboard and resize the view
3. unfocuses the text field to dismiss the keyboard and resize the view
4. verify that the final widget size matches the initial size
2017-05-11 14:29:20 -07:00

32 lines
1.1 KiB
Dart

// 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 'dart:io';
import '../framework/adb.dart';
import '../framework/framework.dart';
import '../framework/ios.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(testDirectory, () async {
await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
await prepareProvisioningCertificates(testDirectory.path);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios']);
}
await flutter('drive', options: <String>['-d', deviceId, 'lib/keyboard_resize.dart']);
});
return new TaskResult.success(<String, dynamic>{});
}