Sped up the time to find macrobenchmarks. (#131959)

This reduce the execution time of macrobenchmarks driver tests.

I tried to find the exact size to scroll the screen but I couldn't find a way to do that with driver tests.
This commit is contained in:
gaaclarke 2023-08-04 16:41:24 -07:00 committed by GitHub
parent 53082f65b5
commit 11025e4acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,11 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as
expect(scrollable, isNotNull);
final SerializableFinder button = find.byValueKey(routeName);
expect(button, isNotNull);
await driver.scrollUntilVisible(scrollable, button, dyScroll: -100.0);
// -320 comes from the logical pixels for a full screen scroll for the
// smallest reference device, iPhone 4, whose physical screen dimensions are
// 960px × 640px.
const double dyScroll = -320.0;
await driver.scrollUntilVisible(scrollable, button, dyScroll: dyScroll);
await driver.tap(button);
await body(driver);