testfairy 1.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 63

testfairy #

TestFairy integration for Flutter, bundles with the native SDK.

Installation #

See details...

Quick Start #

Include the library and run your main app like this.

# inside pubspec.yaml

dependencies:
  testfairy: any
// inside your main.dart

import 'package:testfairy/testfairy.dart';

void main() {
    HttpOverrides.runWithHttpOverrides(
         () async {
           try {
             // Enables widget error logging
             FlutterError.onError =
                 (details) => TestFairy.logError(details.exception);
   
             // Initializes a session
             await TestFairy.begin(TOKEN);
   
             // Runs your app
             runApp(TestfairyExampleApp());
           } catch (error) {
   
             // Logs synchronous errors
             TestFairy.logError(error);
   
           }
         },
   
         // Logs network events
         TestFairy.httpOverrides(),
   
         // Logs asynchronous errors
         onError: TestFairy.logError,
   
         // Logs console messages
         zoneSpecification: new ZoneSpecification(
           print: (self, parent, zone, message) {
             TestFairy.log(message);
           },
         )
     );
}

How to update native SDKs? #

This is done automatically for Android.

If you want to update the native iOS SDK used by this integration, run pod install in your ios directory. This will fix all the syntax errors in TestFairyFlutterPlugin.m file if there is any due to an update.

Docs #

Go to docs...

Features supported by both Android and iOS #

  • begin
  • beginWithOptions
  • setServerEndpoint
  • getVersion
  • sendUserFeedback
  • addCheckpoint
  • addEvent
  • setCorrelationId
  • identifyWithTraits
  • identify
  • setUserId
  • setAttribute
  • getSessionUrl
  • showFeedbackForm
  • stop
  • resume
  • pause
  • log
  • setScreenName
  • didLastSessionCrash
  • enableCrashHandler
  • disableCrashHandler
  • enableMetric
  • disableMetric
  • enableFeedbackForm
  • disableFeedbackForm
  • setMaxSessionLength
  • enableVideo
  • disableVideo
  • bringFlutterToFront

Features supported by only Android #

  • setFeedbackOptions

Features not supported by any platform yet #

  • enableVideo
  • disableVideo
  • takeScreenshot

Development #

  1. Install Flutter.
  2. Connect an Android device.
  3. Run flutter packages get in both root and example folder.
  4. Run ./test.sh in the main folder and wait for tests to complete.
  5. (Optional) Run ./run.sh and tap buttons to see what happens.
  6. (Optional) Run ./profile.sh in the main folder and tap around to benchmark.
  7. Edit example/lib/main.dart and example/test_driver/app_test.dart to add a test case.
  8. Edit lib/testfairy_flutter.dart to add more SDK integration.
  9. Run ./docs.sh to generate documentation for offline usage.

TODO #

  1. Add video and screenshot support on Android.
  2. Add feedback options support for iOS.

1.0.1 #

  • iOS support.

1.0.0 #

  • Initial release.
  • Android support.

example/README.md

Example SDK App (also includes test cases) #

Demonstrates how to use the TestFairy plugin. Execute flutter run in this folder to see it in action.

Use this package as a library

1. Depend on it

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


dependencies:
  testfairy: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:testfairy/testfairy.dart';
  
Version Uploaded Documentation Archive
1.0.2 Jun 11, 2019 Go to the documentation of testfairy 1.0.2 Download testfairy 1.0.2 archive
1.0.1 Apr 17, 2019 Go to the documentation of testfairy 1.0.1 Download testfairy 1.0.1 archive
1.0.0 Mar 13, 2019 Go to the documentation of testfairy 1.0.0 Download testfairy 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/network_logging.dart. (-7.24 points)

Analysis of lib/src/network_logging.dart reported 15 hints, including:

line 40 col 3: Avoid return types on setters.

line 50 col 3: Avoid return types on setters.

line 60 col 3: Avoid return types on setters.

line 70 col 3: Avoid return types on setters.

line 80 col 3: Avoid return types on setters.

Fix lib/src/feedback_options.dart. (-1 points)

Analysis of lib/src/feedback_options.dart reported 2 hints:

line 19 col 6: Name non-constant identifiers using lowerCamelCase.

line 22 col 6: Name non-constant identifiers using lowerCamelCase.

Fix lib/src/testfairy_base.dart. (-0.50 points)

Analysis of lib/src/testfairy_base.dart reported 1 hint:

line 95 col 60: The member 'screenshot' can only be used within instance members of subclasses of 'package:flutter/src/widgets/widget_inspector.dart'.

Format lib/testfairy.dart.

Run flutter format to format lib/testfairy.dart.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8