screenshot update

This commit is contained in:
Thibault Deckers 2022-08-13 16:04:51 +02:00
parent 1f8a2958f1
commit 1d4d0307d7
32 changed files with 46 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

View file

@ -59,7 +59,7 @@ class ExpandableFilterRow extends StatelessWidget {
final filterList = filters.toList();
final wrap = Container(
key: ValueKey('wrap$title'),
key: Key('wrap$title'),
padding: const EdgeInsets.symmetric(horizontal: horizontalPadding),
// specify transparent as a workaround to prevent
// chip border clipping when the floating app bar is fading
@ -71,7 +71,7 @@ class ExpandableFilterRow extends StatelessWidget {
),
);
final list = Container(
key: ValueKey('list$title'),
key: Key('list$title'),
// specify transparent as a workaround to prevent
// chip border clipping when the floating app bar is fading
color: Colors.transparent,

View file

@ -7,12 +7,14 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MapOverlayButton extends StatelessWidget {
final Key? buttonKey;
final Widget icon;
final String tooltip;
final VoidCallback? onPressed;
const MapOverlayButton({
super.key,
this.buttonKey,
required this.icon,
required this.tooltip,
required this.onPressed,
@ -40,6 +42,7 @@ class MapOverlayButton extends StatelessWidget {
child: Selector<MapThemeData, VisualDensity?>(
selector: (context, v) => v.visualDensity,
builder: (context, visualDensity, child) => IconButton(
key: buttonKey,
iconSize: 20,
visualDensity: visualDensity,
icon: icon,

View file

@ -123,6 +123,8 @@ class MapButtonPanel extends StatelessWidget {
Padding(
padding: EdgeInsets.only(top: padding),
child: MapOverlayButton(
// key is expected by test driver
buttonKey: const Key('map-menu-layers'),
icon: const Icon(AIcons.layers),
onPressed: () => showSelectionDialog<EntryMapStyle>(
context: context,

View file

@ -376,7 +376,7 @@ class _EntryPageViewState extends State<EntryPageView> {
return Magnifier(
// key includes modified date to refresh when the image is modified by metadata (e.g. rotated)
key: ValueKey('${entry.uri}_${entry.pageId}_${entry.dateModifiedSecs}'),
key: Key('${entry.uri}_${entry.pageId}_${entry.dateModifiedSecs}'),
controller: controller ?? _magnifierController,
childSize: displaySize ?? entry.displaySize,
allowOriginalScaleBeyondRange: !isWallpaperMode,

View file

@ -3,7 +3,6 @@ import 'package:aves/model/settings/defaults.dart';
import 'package:aves/model/settings/enums/enums.dart';
import 'package:aves/model/settings/settings.dart';
import 'package:aves/model/source/enums.dart';
import 'package:aves_map/src/style.dart';
import 'package:aves/widgets/filter_grids/countries_page.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'package:flutter_test/flutter_test.dart';
@ -46,7 +45,6 @@ Future<void> configureAndLaunch() async {
..showOverlayThumbnailPreview = false
..viewerUseCutout = true
// info
..infoMapStyle = EntryMapStyle.stamenWatercolor
..infoMapZoom = 13
..coordinateFormat = CoordinateFormat.dms
..unitSystem = UnitSystem.metric;

View file

@ -56,6 +56,7 @@ void main() {
info();
stats();
countries();
map();
});
}, timeout: const Timeout(Duration(seconds: 30)));
}
@ -64,10 +65,15 @@ Future<void> _search(String query, String chipKey) async {
await driver.tapKeyAndWait('menu-searchCollection');
await driver.tap(find.byType('TextField'));
await driver.enterText(query);
final chip = find.byValueKey(chipKey);
await driver.waitFor(chip);
await driver.tap(chip);
await driver.waitUntilNoTransientCallbacks();
await driver.tapKeyAndWait(chipKey);
}
Future<void> _selectMapStyle(String style) async {
await driver.tapKeyAndWait('map-menu-layers');
await driver.tapKeyAndWait('EntryMapStyle.$style');
// tiles may take time to load
await Future.delayed(const Duration(seconds: 5));
}
Future<void> _takeScreenshot(FlutterDriver driver, String name) async {
@ -152,8 +158,7 @@ void info() {
final verticalPageView = find.byValueKey('vertical-pageview');
await driver.scrollY(verticalPageView, -600);
// tiles may take time to load
await Future.delayed(const Duration(seconds: 5));
await _selectMapStyle('stamenWatercolor');
await _takeScreenshot(driver, '3');
@ -184,7 +189,7 @@ void stats() {
final maxYear = DateTime.now().year + 1;
final maxQuery = 'year<$maxYear';
const minQuery = 'year>2012';
const minQuery = 'year>2005';
await _search(maxQuery, 'query-$maxQuery');
await _search(minQuery, 'query-$minQuery');
@ -206,3 +211,23 @@ void countries() {
await _takeScreenshot(driver, '6');
});
}
void map() {
test('7. Map', () async {
await driver.tapKeyAndWait('appbar-leading-button');
await driver.tapKeyAndWait('drawer-type-null');
await _search('animals', 'tag-animals');
await _search('Singapore', 'location-LocationLevel.country-Singapore');
await driver.tapKeyAndWait('appbar-menu-button');
await driver.tapKeyAndWait('menu-map');
await _selectMapStyle('googleTerrain');
await _takeScreenshot(driver, '7');
await pressDeviceBackButton();
await driver.waitUntilNoTransientCallbacks();
});
}

View file

@ -165,10 +165,7 @@ void searchAlbum() {
await driver.tap(find.byType('TextField'));
await driver.enterText(albumDisplayName);
final albumChip = find.byValueKey('album-$albumPath');
await driver.waitFor(albumChip);
await driver.tap(albumChip);
await driver.waitUntilNoTransientCallbacks();
await driver.tapKeyAndWait('album-$albumPath');
});
}

View file

@ -1,3 +1,4 @@
// ignore_for_file: avoid_print
import 'package:aves/widgets/debug/app_debug_action.dart';
import 'package:flutter_driver/flutter_driver.dart';
@ -19,7 +20,10 @@ extension ExtraFlutterDriver on FlutterDriver {
}
Future<void> tapKeyAndWait(String key) async {
await tap(find.byValueKey(key));
print(' find key=$key');
final finder = find.byValueKey(key);
await waitFor(finder);
await tap(finder);
await waitUntilNoTransientCallbacks();
}