eBay / flutter_glove_box

Various eBay tools for Flutter development
BSD 3-Clause "New" or "Revised" License
323 stars 69 forks source link

golden tests failing because of unknown device with dimension 800x600 #187

Open IlyaMax opened 9 months ago

IlyaMax commented 9 months ago

image Here is my configuration:

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
  return GoldenToolkit.runWithConfiguration(
    () async {
      await loadAppFonts();
      await testMain();
    },
    config: GoldenToolkitConfiguration(
      defaultDevices: const [
        // iPhone SE, iPhone 5, 5S, 5C
        Device(name: '9x16(small)', size: Size(320, 568)),
        Device(name: '9x16(design)', size: Size(414, 736)),
        Device(name: '9x16(medium)', size: Size(375, 667)),
        Device(name: '9x16(big)', size: Size(414, 736)),
        Device(name: '9x20(common)', size: Size(360, 800)),
        Device(name: '9x19.5(small)', size: Size(375, 812)),
        Device(name: '9x19.5(medium)', size: Size(414, 896)),
        Device(name: '9x19.5(big)', size: Size(430, 932)),
      ],
    ),
  );
}
///pumpHomeScreen just pumps material app widget like this return tester.pumpWidget(...);
///here is test:
  testGoldens(
    'home screen with active long loan',
    (tester) async {
      await pumpHomeScreen(tester);
      await multiScreenGolden(
        tester,
        'home screen with active long',
      );
    },
  );
IlyaMax commented 9 months ago

temporary fixed as final dynamic config = Zone.current[#goldentoolkit.config]; and setting surfaceSize: (config as GoldenToolkitConfiguration).defaultDevices[0].size to pumpWidgetBuilder. I can contribute this if it will be accepted