Unverified Commit f2bb39d6 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Gallery transition tests pass when device rotated (#75672)

parent ac13cd35
......@@ -33,13 +33,16 @@ Future<void> runDemos(List<String> demos, WidgetController controller) async {
print('> $demo');
await controller.pump(const Duration(milliseconds: 250));
final Finder demoCategoryItem = find.text(demoCategory);
if (currentDemoCategory == null) {
await controller.tap(find.text(demoCategory));
await controller.scrollUntilVisible(demoCategoryItem, 48.0);
await controller.tap(demoCategoryItem);
await controller.pumpAndSettle();
} else if (currentDemoCategory != demoCategory) {
await controller.tap(find.byTooltip('Back'));
await controller.pumpAndSettle();
await controller.tap(find.text(demoCategory));
await controller.scrollUntilVisible(demoCategoryItem, 48.0);
await controller.tap(demoCategoryItem);
await controller.pumpAndSettle();
// Scroll back to the top
await controller.drag(demoList, const Offset(0.0, 10000.0));
......
......@@ -116,11 +116,14 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async {
final String demoCategory = demo.substring(demo.indexOf('@') + 1);
print('> $demo');
final SerializableFinder demoCategoryItem = find.text(demoCategory);
if (currentDemoCategory == null) {
await driver.tap(find.text(demoCategory));
await driver.scrollIntoView(demoCategoryItem);
await driver.tap(demoCategoryItem);
} else if (currentDemoCategory != demoCategory) {
await driver.tap(find.byTooltip('Back'));
await driver.tap(find.text(demoCategory));
await driver.scrollIntoView(demoCategoryItem);
await driver.tap(demoCategoryItem);
// Scroll back to the top
await driver.scroll(demoList, 0.0, 10000.0, const Duration(milliseconds: 100));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment