flutter_vizzy_lib 1.0.0 flutter_vizzy_lib: ^1.0.0 copied to clipboard
Vizzy integration library for Flutter
flutter_vizzy_lib #
Vizzy integration library for Flutter
Getting Started #
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Library usage #
Add Vizzy to setUpAll(()
on the test_driver initializing it with the parameters of the server and
the current FlutterDriver used to drive the tests
FlutterDriver driver;
Vizzy vizzy;
setUpAll(() async {
driver = await FlutterDriver.connect();
// Params can be read from environment variables too
vizzy = Vizzy(
driver: driver,
projectId: <project-id>,
token: <your-user-token>,
username: <your-email>,
url: <vizzy-server-url>
);
});
Inside your current instrumentation tests, add vizzy.takeScreenshot()
to add a snapshot test of the
current UI
test('simple screenshot test', () async {
await vizzy.takeScreenshot('home_screen');
});
Add vizzy.verifyImages()
to tearDownAll()
to trigger the verification of the images
tearDownAll(() async {
if (driver != null) {
driver.close();
await vizzy.verifyImages();
}
});