[flutter_driver] support send text input action (#106561)
* Support receive input action * Fix error syntax * Fix compile * Add documents * Add unit-test * Update import * Fixed unit-test and lint * Add authors for me * Fixed lint * Fixed lint * Add example * Fixed lint * Fix gen docs * Revert code * Remove flutter_dev * Update packages/flutter_driver/lib/src/driver/driver.dart Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> * Update packages/flutter_driver/lib/src/common/action.dart Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> * Update packages/flutter_driver/lib/src/common/action.dart Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> * Rename ReceiveAction to SendTextInputAction * Rename DriverTextInputAction to TextInputAction and fix unit-test * Reorder import * Remove space * Reorder import * Update text_input.dart * Update flutter_driver_test.dart * Update comment to normal comment after dart doc * Update example * Update AUTHORS Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> * Fix analyze * Add type dart for example * Add unit-test to check the same entries Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:fake_async/fake_async.dart';
|
||||
import 'package:flutter_driver/src/common/error.dart';
|
||||
import 'package:flutter_driver/src/common/health.dart';
|
||||
import 'package:flutter_driver/src/common/layer_tree.dart';
|
||||
import 'package:flutter_driver/src/common/text_input_action.dart';
|
||||
import 'package:flutter_driver/src/common/wait.dart';
|
||||
import 'package:flutter_driver/src/driver/driver.dart';
|
||||
import 'package:flutter_driver/src/driver/timeline.dart';
|
||||
@@ -351,6 +352,16 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('sendTextInputAction', () {
|
||||
test('sends the SendTextInputAction command with action done', () async {
|
||||
fakeClient.responses['send_text_input_action'] = makeFakeResponse(<String, dynamic>{});
|
||||
await driver.sendTextInputAction(TextInputAction.done, timeout: _kTestTimeout);
|
||||
expect(fakeClient.commandLog, <String>[
|
||||
'ext.flutter.driver {command: send_text_input_action, timeout: $_kSerializedTestTimeout, action: done}',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
group('getLayerTree', () {
|
||||
test('sends the getLayerTree command', () async {
|
||||
fakeClient.responses['get_layer_tree'] = makeFakeResponse(<String, String>{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// 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_driver/flutter_driver.dart' as flutter_driver;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
test('flutter_driver.TextInputAction should be sync with TextInputAction',
|
||||
() {
|
||||
final List<String> actual = flutter_driver.TextInputAction.values
|
||||
.map((flutter_driver.TextInputAction action) => action.name)
|
||||
.toList();
|
||||
final List<String> matcher = TextInputAction.values
|
||||
.map((TextInputAction action) => action.name)
|
||||
.toList();
|
||||
expect(actual, matcher);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user