testfairy 1.0.1 testfairy: ^1.0.1 copied to clipboard
TestFairy integration for Flutter, bundles with the native SDK
testfairy #
TestFairy integration for Flutter, bundles with the native SDK.
Installation #
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() {
runZoned(
() async {
try {
FlutterError.onError = (details) => TestFairy.logError(details.exception);
// Do any other SDK setup here
await TestFairy.begin('TOKEN');
runApp(TestfairyExampleApp());
} catch (error) {
TestFairy.logError(error);
}
},
onError: TestFairy.logError,
zoneSpecification: new ZoneSpecification(
print: (self, parent, zone, message) => TestFairy.log(message)
)
);
}
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
bringFlutterToFront
Features supported by only iOS #
enableVideo
disableVideo
takeScreenshot
Features supported by only Android #
setFeedbackOptions
logError
Development #
- Install Flutter.
- Connect an Android device.
- Run
flutter packages get
in both root and example folder. - Run
./test.sh
in the main folder and wait for tests to complete. - (Optional) Run
./run.sh
and tap buttons to see what happens. - (Optional) Run
./profile.sh
in the main folder and tap around to benchmark. - Edit example/lib/main.dart and example/test_driver/app_test.dart to add a test case.
- Edit lib/testfairy_flutter.dart to add more SDK integration.
- Run
./docs.sh
to generate documentation for offline usage.
TODO #
- Add video and screenshot support on Android.
- Add feedback options support for iOS.
- Add
hideView
for both platforms. - Add network logging for both platforms.