Test that view padding is applied on show keyboard (#10190)

Ensure that showing the keyboard applies padding, reducing the view
height.
This commit is contained in:
Chris Bracken 2017-05-18 18:29:43 -07:00 committed by GitHub
parent fdbb1fbbc7
commit 568bf06cc1

View File

@ -30,6 +30,10 @@ void main() {
await driver.tap(defaultTextField);
await new Future<Null>.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);