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
e00d87ff
Unverified
Commit
e00d87ff
authored
Oct 19, 2021
by
LongCatIsLooong
Committed by
GitHub
Oct 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[keyboard_textfield_test] wait until the keyboard becomes visible (#92032)
parent
63c43a5e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
keyboard_textfield.dart
dev/integration_tests/ui/lib/keyboard_textfield.dart
+10
-0
keyboard_textfield_test.dart
...gration_tests/ui/test_driver/keyboard_textfield_test.dart
+2
-1
No files found.
dev/integration_tests/ui/lib/keyboard_textfield.dart
View file @
e00d87ff
...
...
@@ -47,14 +47,24 @@ class _MyHomePageState extends State<MyHomePage> {
});
}
@override
void
dispose
()
{
_controller
.
dispose
();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
final
String
softKeyboardVisibility
=
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
>
100
?
'keyboard visible'
:
'keyboard not visible'
;
return
Scaffold
(
body:
Column
(
children:
<
Widget
>[
Text
(
'
$offset
'
,
key:
const
ValueKey
<
String
>(
keys
.
kOffsetText
),
),
Text
(
softKeyboardVisibility
),
Expanded
(
child:
ListView
(
key:
const
ValueKey
<
String
>(
keys
.
kListView
),
...
...
dev/integration_tests/ui/test_driver/keyboard_textfield_test.dart
View file @
e00d87ff
...
...
@@ -24,6 +24,7 @@ void main() {
final
SerializableFinder
listViewFinder
=
find
.
byValueKey
(
keys
.
kListView
);
final
SerializableFinder
textFieldFinder
=
find
.
byValueKey
(
keys
.
kDefaultTextField
);
final
SerializableFinder
offsetFinder
=
find
.
byValueKey
(
keys
.
kOffsetText
);
final
SerializableFinder
keyboardVisibilityIndicatorFinder
=
find
.
text
(
'keyboard visible'
);
// Align TextField with bottom edge to ensure it would be covered when keyboard comes up.
await
driver
.
waitForAbsent
(
textFieldFinder
);
...
...
@@ -38,7 +39,7 @@ void main() {
// Bring up keyboard
await
driver
.
tap
(
textFieldFinder
);
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
1
)
);
await
driver
.
waitFor
(
keyboardVisibilityIndicatorFinder
);
// Ensure that TextField is visible again
await
driver
.
waitFor
(
textFieldFinder
);
...
...
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