Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fbd6dd64
Unverified
Commit
fbd6dd64
authored
Aug 04, 2020
by
gaaclarke
Committed by
GitHub
Aug 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a more generous timeout period for the keyboard animation. (#62628)
parent
31ee51a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
16 deletions
+36
-16
README.md
dev/integration_tests/README.md
+14
-7
keyboard_resize_test.dart
...ntegration_tests/ui/test_driver/keyboard_resize_test.dart
+22
-9
No files found.
dev/integration_tests/README.md
View file @
fbd6dd64
Automated Flutter integration test suites. Each suite consists of either a
complete Flutter app and a
`flutter_driver`
specification that drives tests
from the UI, or a native app that is meant to integrate with Flutter for
testing.
# Automated Flutter integration test suites
Each suite consists of either a complete Flutter app and a
`flutter_driver`
specification that drives tests from the UI, or a native app that is meant to
integrate with Flutter for testing.
Intended for use with devicelab tests.
If you want to run a driver test locally, to debug a problem with a test,
you
can use this command from the appropriate subdirectory:
If you want to run a driver test locally, to debug a problem with a test,
you
can use this command from the appropriate subdirectory:
```
shell
% flutter drive
flutter drive
-t
<
test
>
--driver
<driver>
```
For example:
```
sh
flutter drive
-t
lib/keyboard_resize.dart
--driver
test_driver/keyboard_resize_test.dart
```
dev/integration_tests/ui/test_driver/keyboard_resize_test.dart
View file @
fbd6dd64
...
...
@@ -33,22 +33,35 @@ void main() {
final
SerializableFinder
defaultTextField
=
find
.
byValueKey
(
keys
.
kDefaultTextField
);
await
driver
.
waitFor
(
defaultTextField
);
await
driver
.
tap
(
defaultTextField
);
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
bool
heightTextDidShrink
=
false
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
await
Future
<
void
>.
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
);
if
(
double
.
parse
(
heightWithKeyboardShown
)
<
double
.
parse
(
startHeight
))
{
heightTextDidShrink
=
true
;
break
;
}
}
expect
(
heightTextDidShrink
,
isTrue
);
// Unfocus the text field to dismiss the keyboard.
final
SerializableFinder
unfocusButton
=
find
.
byValueKey
(
keys
.
kUnfocusButton
);
await
driver
.
waitFor
(
unfocusButton
);
await
driver
.
tap
(
unfocusButton
);
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
bool
heightTextDidExpand
=
false
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
));
// Measure the final height.
final
String
endHeight
=
await
driver
.
getText
(
heightText
);
expect
(
endHeight
,
startHeight
);
if
(
endHeight
==
startHeight
)
{
heightTextDidExpand
=
true
;
break
;
}
}
expect
(
heightTextDidExpand
,
isTrue
);
});
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment