FynkelTester extension

on

Methods

frames([int count = 1]) → Future<void>

Available on WidgetTester, provided by the FynkelTester extension

Pumps count frames, a 60th of a second each: the world runs as on a 60 Hz display, so once a frame at its default targetFrameRate of 60, every other frame at 30, and 10 times a second while a page covers it.
game<T extends GameObject>() → T

Available on WidgetTester, provided by the FynkelTester extension

The game of the first FynkelView on screen, as a T: the root it shows (FynkelViewState.root), made by the game's FynkelApp or FynkelGame or given to the view, whatever type that was made for; for a view of a world, its FynkelGame's. Throws a StateError when there's no view, or its game isn't a T.
loaded([GameObject? object, Duration timeout = const Duration(seconds: 30)]) → Future<void>

Available on WidgetTester, provided by the FynkelTester extension

Waits until object (the game on screen unless given) has loaded what its onLoad loads, and everything added then, and throws its load's error if it failed: await tester.loaded(). The files are read in real time, which a widget test's frames don't move, so it waits a little in real time and pumps a frame, over and over: the game runs meanwhile, as it would. Throws a TimeoutException after timeout of real time.
run(double seconds) → Future<void>

Available on WidgetTester, provided by the FynkelTester extension

Pumps seconds of frames, 60 a second, rounded as world.run rounds them.
until(bool condition(), {Duration timeout = const Duration(seconds: 30)}) → Future<void>

Available on WidgetTester, provided by the FynkelTester extension

Runs the game until condition holds, as loaded does: a little real time for files to be read, then a frame, over and over. For what loaded can't be given, as a level a button makes inside the game: await tester.until(() => game.level == 2). Throws a TimeoutException after timeout of real time.