From 568bf06cc15707a12e95849f79a43f9633733e25 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 18 May 2017 18:29:43 -0700 Subject: [PATCH] Test that view padding is applied on show keyboard (#10190) Ensure that showing the keyboard applies padding, reducing the view height. --- .../ui/test_driver/keyboard_resize_test.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/integration_tests/ui/test_driver/keyboard_resize_test.dart b/dev/integration_tests/ui/test_driver/keyboard_resize_test.dart index 66ab03082b..5d624c60af 100644 --- a/dev/integration_tests/ui/test_driver/keyboard_resize_test.dart +++ b/dev/integration_tests/ui/test_driver/keyboard_resize_test.dart @@ -30,6 +30,10 @@ void main() { await driver.tap(defaultTextField); await new Future.delayed(const Duration(seconds: 1)); + // Measure the height with keyboard displayed. + final String heightWithKeyboardShown = await driver.getText(heightText); + expect(double.parse(heightWithKeyboardShown) < double.parse(startHeight), isTrue); + // Unfocus the text field to dismiss the keyboard. final SerializableFinder unfocusButton = find.byValueKey(keys.kUnfocusButton); await driver.waitFor(unfocusButton);