Gallery transition tests pass when device rotated (#75672)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user