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 { ...@@ -33,13 +33,16 @@ Future<void> runDemos(List<String> demos, WidgetController controller) async {
print('> $demo'); print('> $demo');
await controller.pump(const Duration(milliseconds: 250)); await controller.pump(const Duration(milliseconds: 250));
final Finder demoCategoryItem = find.text(demoCategory);
if (currentDemoCategory == null) { if (currentDemoCategory == null) {
await controller.tap(find.text(demoCategory)); await controller.scrollUntilVisible(demoCategoryItem, 48.0);
await controller.tap(demoCategoryItem);
await controller.pumpAndSettle(); await controller.pumpAndSettle();
} else if (currentDemoCategory != demoCategory) { } else if (currentDemoCategory != demoCategory) {
await controller.tap(find.byTooltip('Back')); await controller.tap(find.byTooltip('Back'));
await controller.pumpAndSettle(); await controller.pumpAndSettle();
await controller.tap(find.text(demoCategory)); await controller.scrollUntilVisible(demoCategoryItem, 48.0);
await controller.tap(demoCategoryItem);
await controller.pumpAndSettle(); await controller.pumpAndSettle();
// Scroll back to the top // Scroll back to the top
await controller.drag(demoList, const Offset(0.0, 10000.0)); await controller.drag(demoList, const Offset(0.0, 10000.0));
......
...@@ -116,11 +116,14 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async { ...@@ -116,11 +116,14 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async {
final String demoCategory = demo.substring(demo.indexOf('@') + 1); final String demoCategory = demo.substring(demo.indexOf('@') + 1);
print('> $demo'); print('> $demo');
final SerializableFinder demoCategoryItem = find.text(demoCategory);
if (currentDemoCategory == null) { if (currentDemoCategory == null) {
await driver.tap(find.text(demoCategory)); await driver.scrollIntoView(demoCategoryItem);
await driver.tap(demoCategoryItem);
} else if (currentDemoCategory != demoCategory) { } else if (currentDemoCategory != demoCategory) {
await driver.tap(find.byTooltip('Back')); 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 // Scroll back to the top
await driver.scroll(demoList, 0.0, 10000.0, const Duration(milliseconds: 100)); 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