flare_splash_screen icon indicating copy to clipboard operation
flare_splash_screen copied to clipboard

Testing with flare_splash_screen requires FlareTesting.setup()

Open rubenvereecken opened this issue 3 years ago • 1 comments

I just wanted to share something, perhaps for the docs? It wasn't super hard to find out why but I couldn't manage to get flutter test driver to work with the splash screen, it just wouldn't show up and the tests would eventually time out. A bit of sleuthing turned up that I had to manually rely on the underlying flare_flutter package and set it up for testing. The resulting test_driver/main.dart is as follows.

import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'package:my_package/main_test.dart' as app;

void main() {
  enableFlutterDriverExtension();
  FlareTesting.setup(); // <-- This here line
  app.main();
}

Just sharing in case anyone else has the same problem or in case it needs to make it into the docs.

rubenvereecken avatar Aug 30 '20 10:08 rubenvereecken

Might be interesting indeed to have that in the Readme ! Thanks for that !

jaumard avatar Aug 30 '20 10:08 jaumard