flutter_vizzy_lib 1.0.6

  • Readme
  • Changelog
  • Installing
  • 45

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

Integration with CICD pipelines #

Vizzy lib will read PULL_REQUEST_NUMBER and COMMIT_SHA from environment variables, if the PR number is not found, it will create a development build. To ensure that Vizzy creates proper builds, do make sure the CICD pipeline sets that especific environment variable.

The other variables such as username, token, url and projectId can also be read from environment variables if they are not passed as constructor variables.

Running a test #

Create a normal driver test and wun it using flutter drive --target=test_driver/app.dart

[1.0.6] - TODO: Add release date. #

  • Initial release of the integration library
  • Provides Vizzy class that allows easy integration with the service

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_vizzy_lib: ^1.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_vizzy_lib/Vizzy.dart';
import 'package:flutter_vizzy_lib/_Md5Util.dart';
import 'package:flutter_vizzy_lib/_VizzyApiClient.dart';
import 'package:flutter_vizzy_lib/_VizzyApiClient.g.dart';
import 'package:flutter_vizzy_lib/_VizzyService.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

64 out of 64 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/Vizzy.dart.

Run flutter format to format lib/Vizzy.dart.

Format lib/_Md5Util.dart.

Run flutter format to format lib/_Md5Util.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_vizzy_lib.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
convert ^2.1.1 2.1.1
crypto ^2.1.3 2.1.3 2.1.4
dio ^3.0.1 3.0.9
flutter_driver 0.0.0
json_annotation ^3.0.0 3.0.1
json_serializable ^3.0.0 3.3.0
meta ^1.1.6 1.1.8
retrofit ^1.2.0 1.3.1+1
Transitive dependencies
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
archive 2.0.11 2.0.13
args 1.5.2 1.6.0
async 2.4.0 2.4.1
boolean_selector 1.0.5 2.0.0
build 1.2.2
build_config 0.4.2
charcode 1.1.2 1.1.3
checked_yaml 1.0.2
collection 1.14.11 1.14.12
csslib 0.16.1
dart_style 1.3.3
file 5.1.0
flutter 0.0.0
fuchsia_remote_debug_protocol 0.0.0
glob 1.2.0
html 0.14.0+3
http_parser 3.1.4
image 2.1.4 2.1.12
intl 0.16.0 0.16.1
js 0.6.1+1
json_rpc_2 2.1.0
logging 0.11.4
matcher 0.12.6
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
path 1.6.4
pedantic 1.8.0+1 1.9.0
petitparser 2.4.0 3.0.2
platform 2.2.1
process 3.0.12
pub_semver 1.4.2 1.4.4
pubspec_parse 0.1.5
quiver 2.0.5 2.1.3
sky_engine 0.0.99
source_gen 0.9.5
source_span 1.5.5 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.11 0.2.15
typed_data 1.1.6
vector_math 2.0.8
vm_service_client 0.2.6+2 0.2.6+3
watcher 0.9.7+14
web_socket_channel 1.1.0
xml 3.5.0 4.1.0
yaml 2.2.0
Dev dependencies
build_runner any
flutter_test 0.0.0
retrofit_generator any
test any