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
1f72406b
Unverified
Commit
1f72406b
authored
Oct 23, 2018
by
xster
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Platform agnostic gallery smoke test (#23423)
parent
e70f1952
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
live_smoketest.dart
examples/flutter_gallery/test/live_smoketest.dart
+24
-4
smoke_test.dart
examples/flutter_gallery/test/smoke_test.dart
+8
-0
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+8
-0
No files found.
examples/flutter_gallery/test/live_smoketest.dart
View file @
1f72406b
...
...
@@ -10,10 +10,11 @@
import
'dart:async'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_gallery/gallery/demos.dart'
;
...
...
@@ -33,12 +34,19 @@ const List<String> _kUnsynchronizedDemoTitles = <String>[
// These demos can't be backed out of by tapping a button whose
// tooltip is 'Back'.
const
List
<
String
>
_kSkippedDemoTitles
=
<
String
>[
'Pull to refresh'
,
'Progress indicators'
,
'Activity Indicator'
,
'Video'
,
];
// There are 3 places where the Gallery demos are traversed.
// 1- In widget tests such as examples/flutter_gallery/test/smoke_test.dart
// 2- In driver tests such as examples/flutter_gallery/test_driver/transitions_perf_test.dart
// 3- In on-device instrumentation tests such as examples/flutter_gallery/test/live_smoketest.dart
//
// If you change navigation behavior in the Gallery or in the framework, make
// sure all 3 are covered.
Future
<
void
>
main
()
async
{
try
{
// Verify that _kUnsynchronizedDemos and _kSkippedDemos identify
...
...
@@ -66,7 +74,7 @@ Future<void> main() async {
await
controller
.
tap
(
demoItem
);
// Launch the demo
controller
.
frameSync
=
!
_kUnsynchronizedDemoTitles
.
contains
(
demo
.
title
);
print
(
'Going back to demo list...'
);
await
controller
.
tap
(
find
.
byTooltip
(
'Back'
)
);
await
controller
.
tap
(
backFinder
);
controller
.
frameSync
=
true
;
}
}
...
...
@@ -81,6 +89,18 @@ Future<void> main() async {
}
}
final
Finder
backFinder
=
find
.
byElementPredicate
(
(
Element
element
)
{
final
Widget
widget
=
element
.
widget
;
if
(
widget
is
Tooltip
)
return
widget
.
message
==
'Back'
;
if
(
widget
is
CupertinoNavigationBarBackButton
)
return
true
;
return
false
;
},
description:
'Material or Cupertino back button'
,
);
class
_LiveWidgetController
extends
LiveWidgetController
{
_LiveWidgetController
(
WidgetsBinding
binding
)
:
super
(
binding
);
...
...
examples/flutter_gallery/test/smoke_test.dart
View file @
1f72406b
...
...
@@ -18,6 +18,14 @@ const String kGalleryTitle = 'Flutter gallery';
// values approved by verityToStringOutput().
int
toStringErrors
=
0
;
// There are 3 places where the Gallery demos are traversed.
// 1- In widget tests such as examples/flutter_gallery/test/smoke_test.dart
// 2- In driver tests such as examples/flutter_gallery/test_driver/transitions_perf_test.dart
// 3- In on-device instrumentation tests such as examples/flutter_gallery/test/live_smoketest.dart
//
// If you change navigation behavior in the Gallery or in the framework, make
// sure all 3 are covered.
void
reportToStringError
(
String
name
,
String
route
,
int
lineNumber
,
List
<
String
>
lines
,
String
message
)
{
// If you're on line 12, then it has index 11.
// If you want 1 line before and 1 line after, then you want lines with index 10, 11, and 12.
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
1f72406b
...
...
@@ -35,6 +35,14 @@ const List<String> kProfiledDemos = <String>[
'Pickers@Material'
,
];
// There are 3 places where the Gallery demos are traversed.
// 1- In widget tests such as examples/flutter_gallery/test/smoke_test.dart
// 2- In driver tests such as examples/flutter_gallery/test_driver/transitions_perf_test.dart
// 3- In on-device instrumentation tests such as examples/flutter_gallery/test/live_smoketest.dart
//
// If you change navigation behavior in the Gallery or in the framework, make
// sure all 3 are covered.
// Demos that will be backed out of within FlutterDriver.runUnsynchronized();
//
// These names must match GalleryItem titles from kAllGalleryDemos
...
...
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