flutter_vizzy_lib 1.0.1 copy "flutter_vizzy_lib: ^1.0.1" to clipboard
flutter_vizzy_lib: ^1.0.1 copied to clipboard

outdated

Vizzy integration library for Flutter

flutter_vizzy_lib #

Vizzy integration library for Flutter

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();
    }
  });