fixed driver test
This commit is contained in:
parent
5f45d04e87
commit
d95619d722
6 changed files with 38 additions and 4 deletions
|
@ -42,6 +42,7 @@ class FilterGridPage<T extends CollectionFilter> extends StatelessWidget {
|
||||||
static const spacing = 8.0;
|
static const spacing = 8.0;
|
||||||
|
|
||||||
FilterGridPage({
|
FilterGridPage({
|
||||||
|
Key key,
|
||||||
@required this.source,
|
@required this.source,
|
||||||
@required this.appBar,
|
@required this.appBar,
|
||||||
@required this.filterEntries,
|
@required this.filterEntries,
|
||||||
|
@ -52,7 +53,7 @@ class FilterGridPage<T extends CollectionFilter> extends StatelessWidget {
|
||||||
double appBarHeight = kToolbarHeight,
|
double appBarHeight = kToolbarHeight,
|
||||||
@required this.onTap,
|
@required this.onTap,
|
||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
}) {
|
}) : super(key: key) {
|
||||||
_appBarHeightNotifier.value = appBarHeight;
|
_appBarHeightNotifier.value = appBarHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ class FilterNavigationPage<T extends CollectionFilter> extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FilterGridPage<T>(
|
return FilterGridPage<T>(
|
||||||
|
key: ValueKey('filter-grid-page'),
|
||||||
source: source,
|
source: source,
|
||||||
appBar: SliverAppBar(
|
appBar: SliverAppBar(
|
||||||
title: TappableAppBarTitle(
|
title: TappableAppBarTitle(
|
||||||
|
|
|
@ -23,6 +23,7 @@ class PanoramaPage extends StatelessWidget {
|
||||||
expectedContentLength: entry.sizeBytes,
|
expectedContentLength: entry.sizeBytes,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// TODO TLAD toggle sensor control
|
||||||
sensorControl: SensorControl.None,
|
sensorControl: SensorControl.None,
|
||||||
),
|
),
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,8 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
agreeToTerms();
|
agreeToTerms();
|
||||||
|
visitAbout();
|
||||||
|
visitSettings();
|
||||||
sortCollection();
|
sortCollection();
|
||||||
groupCollection();
|
groupCollection();
|
||||||
selectFirstAlbum();
|
selectFirstAlbum();
|
||||||
|
@ -43,7 +45,7 @@ void main() {
|
||||||
test('contemplation', () async {
|
test('contemplation', () async {
|
||||||
await Future.delayed(Duration(seconds: 5));
|
await Future.delayed(Duration(seconds: 5));
|
||||||
});
|
});
|
||||||
}, timeout: Timeout(Duration(seconds: 10)));
|
}, timeout: Timeout(Duration(seconds: 30)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void agreeToTerms() {
|
void agreeToTerms() {
|
||||||
|
@ -60,6 +62,30 @@ void agreeToTerms() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void visitAbout() {
|
||||||
|
test('[collection] visit about page', () async {
|
||||||
|
await driver.tap(find.byValueKey('appbar-leading-button'));
|
||||||
|
await driver.waitUntilNoTransientCallbacks();
|
||||||
|
|
||||||
|
await driver.tap(find.byValueKey('About-tile'));
|
||||||
|
await driver.waitUntilNoTransientCallbacks();
|
||||||
|
|
||||||
|
await pressDeviceBackButton();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void visitSettings() {
|
||||||
|
test('[collection] visit about page', () async {
|
||||||
|
await driver.tap(find.byValueKey('appbar-leading-button'));
|
||||||
|
await driver.waitUntilNoTransientCallbacks();
|
||||||
|
|
||||||
|
await driver.tap(find.byValueKey('Settings-tile'));
|
||||||
|
await driver.waitUntilNoTransientCallbacks();
|
||||||
|
|
||||||
|
await pressDeviceBackButton();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void sortCollection() {
|
void sortCollection() {
|
||||||
test('[collection] sort', () async {
|
test('[collection] sort', () async {
|
||||||
await driver.tap(find.byValueKey('appbar-menu-button'));
|
await driver.tap(find.byValueKey('appbar-menu-button'));
|
||||||
|
@ -92,8 +118,11 @@ void selectFirstAlbum() {
|
||||||
await driver.tap(find.byValueKey('Albums-tile'));
|
await driver.tap(find.byValueKey('Albums-tile'));
|
||||||
await driver.waitUntilNoTransientCallbacks();
|
await driver.waitUntilNoTransientCallbacks();
|
||||||
|
|
||||||
|
// wait for collection loading
|
||||||
|
await driver.waitForCondition(NoPendingPlatformMessages());
|
||||||
|
|
||||||
await driver.tap(find.descendant(
|
await driver.tap(find.descendant(
|
||||||
of: find.byType('FilterGridPage'),
|
of: find.byValueKey('filter-grid-page'),
|
||||||
matching: find.byType('DecoratedFilterChip'),
|
matching: find.byType('DecoratedFilterChip'),
|
||||||
firstMatchOnly: true,
|
firstMatchOnly: true,
|
||||||
));
|
));
|
||||||
|
|
|
@ -42,3 +42,5 @@ Future<void> copyContent(String sourceDir, String targetDir) async {
|
||||||
Future<void> grantPermissions(String packageName, Iterable<String> permissions) async {
|
Future<void> grantPermissions(String packageName, Iterable<String> permissions) async {
|
||||||
await Future.forEach(permissions, (permission) => runAdb(['shell', 'pm', 'grant', packageName, permission]));
|
await Future.forEach(permissions, (permission) => runAdb(['shell', 'pm', 'grant', packageName, permission]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> pressDeviceBackButton() => runAdb(['shell', 'input', 'keyevent', 'KEYCODE_BACK']);
|
||||||
|
|
Loading…
Reference in a new issue