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;
|
||||
|
||||
FilterGridPage({
|
||||
Key key,
|
||||
@required this.source,
|
||||
@required this.appBar,
|
||||
@required this.filterEntries,
|
||||
|
@ -52,7 +53,7 @@ class FilterGridPage<T extends CollectionFilter> extends StatelessWidget {
|
|||
double appBarHeight = kToolbarHeight,
|
||||
@required this.onTap,
|
||||
this.onLongPress,
|
||||
}) {
|
||||
}) : super(key: key) {
|
||||
_appBarHeightNotifier.value = appBarHeight;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ class FilterNavigationPage<T extends CollectionFilter> extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FilterGridPage<T>(
|
||||
key: ValueKey('filter-grid-page'),
|
||||
source: source,
|
||||
appBar: SliverAppBar(
|
||||
title: TappableAppBarTitle(
|
||||
|
|
|
@ -23,6 +23,7 @@ class PanoramaPage extends StatelessWidget {
|
|||
expectedContentLength: entry.sizeBytes,
|
||||
),
|
||||
),
|
||||
// TODO TLAD toggle sensor control
|
||||
sensorControl: SensorControl.None,
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,8 @@ void main() {
|
|||
});
|
||||
|
||||
agreeToTerms();
|
||||
visitAbout();
|
||||
visitSettings();
|
||||
sortCollection();
|
||||
groupCollection();
|
||||
selectFirstAlbum();
|
||||
|
@ -43,7 +45,7 @@ void main() {
|
|||
test('contemplation', () async {
|
||||
await Future.delayed(Duration(seconds: 5));
|
||||
});
|
||||
}, timeout: Timeout(Duration(seconds: 10)));
|
||||
}, timeout: Timeout(Duration(seconds: 30)));
|
||||
}
|
||||
|
||||
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() {
|
||||
test('[collection] sort', () async {
|
||||
await driver.tap(find.byValueKey('appbar-menu-button'));
|
||||
|
@ -92,8 +118,11 @@ void selectFirstAlbum() {
|
|||
await driver.tap(find.byValueKey('Albums-tile'));
|
||||
await driver.waitUntilNoTransientCallbacks();
|
||||
|
||||
// wait for collection loading
|
||||
await driver.waitForCondition(NoPendingPlatformMessages());
|
||||
|
||||
await driver.tap(find.descendant(
|
||||
of: find.byType('FilterGridPage'),
|
||||
of: find.byValueKey('filter-grid-page'),
|
||||
matching: find.byType('DecoratedFilterChip'),
|
||||
firstMatchOnly: true,
|
||||
));
|
||||
|
|
|
@ -42,3 +42,5 @@ Future<void> copyContent(String sourceDir, String targetDir) async {
|
|||
Future<void> grantPermissions(String packageName, Iterable<String> permissions) async {
|
||||
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