Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IlyaMax opened this issue Feb 9, 2024 · 1 comment
Open

Comments

@IlyaMax
Copy link

IlyaMax commented Feb 9, 2024

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
Copy link
Author

IlyaMax commented Feb 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant