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
4226bff7
Unverified
Commit
4226bff7
authored
Mar 28, 2018
by
Hans Muller
Committed by
GitHub
Mar 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated memory_nav_test with FlutterDriver.scrollUntilVisible() (#16009)
parent
c5288c73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
23 deletions
+13
-23
memory_nav_test.dart
examples/flutter_gallery/test_driver/memory_nav_test.dart
+9
-18
scroll_perf_test.dart
examples/flutter_gallery/test_driver/scroll_perf_test.dart
+4
-5
No files found.
examples/flutter_gallery/test_driver/memory_nav_test.dart
View file @
4226bff7
import
'dart:async'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:test/test.dart'
;
const
Duration
kWaitBetweenActions
=
const
Duration
(
milliseconds:
250
);
void
main
(
)
{
group
(
'flutter gallery transitions'
,
()
{
FlutterDriver
driver
;
...
...
@@ -18,21 +14,16 @@ void main() {
});
test
(
'navigation'
,
()
async
{
final
Completer
<
Null
>
completer
=
new
Completer
<
Null
>();
bool
scroll
=
true
;
final
SerializableFinder
menuItem
=
find
.
text
(
'Text fields'
);
driver
.
waitFor
(
menuItem
).
then
<
Null
>((
Null
value
)
async
{
scroll
=
false
;
for
(
int
i
=
0
;
i
<
15
;
i
++)
{
await
driver
.
tap
(
menuItem
);
await
driver
.
tap
(
find
.
byTooltip
(
'Back'
));
}
completer
.
complete
();
});
while
(
scroll
)
{
await
driver
.
scroll
(
find
.
text
(
'Flutter Gallery'
),
0.0
,
-
500.0
,
const
Duration
(
milliseconds:
80
));
await
driver
.
scrollUntilVisible
(
find
.
byType
(
'CustomScrollView'
),
menuItem
,
dyScroll:
-
300.0
,
alignment:
0.5
,
timeout:
const
Duration
(
minutes:
1
),
);
for
(
int
i
=
0
;
i
<
15
;
i
++)
{
await
driver
.
tap
(
menuItem
);
await
driver
.
tap
(
find
.
byTooltip
(
'Back'
));
}
await
completer
.
future
;
},
timeout:
const
Timeout
(
const
Duration
(
minutes:
1
)));
});
});
}
examples/flutter_gallery/test_driver/scroll_perf_test.dart
View file @
4226bff7
...
...
@@ -22,9 +22,8 @@ void main() {
test
(
'measure'
,
()
async
{
final
Timeline
timeline
=
await
driver
.
traceAction
(()
async
{
// Find the scrollable stock list
final
SerializableFinder
stockList
=
find
.
byValueKey
(
'Gallery List'
);
expect
(
stockList
,
isNotNull
);
final
SerializableFinder
home
=
find
.
byValueKey
(
'Gallery List'
);
expect
(
home
,
isNotNull
);
await
driver
.
tap
(
find
.
text
(
'Vignettes'
));
await
driver
.
tap
(
find
.
text
(
'Components'
));
...
...
@@ -34,13 +33,13 @@ void main() {
// https://github.com/flutter/flutter/issues/3316
// Scroll down
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
await
driver
.
scroll
(
stockList
,
0.0
,
-
300.0
,
const
Duration
(
milliseconds:
300
));
await
driver
.
scroll
(
home
,
0.0
,
-
300.0
,
const
Duration
(
milliseconds:
300
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
// Scroll up
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
await
driver
.
scroll
(
stockList
,
0.0
,
300.0
,
const
Duration
(
milliseconds:
300
));
await
driver
.
scroll
(
home
,
0.0
,
300.0
,
const
Duration
(
milliseconds:
300
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
});
...
...
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