automated_testing_framework_plugin_sqflite 1.0.1
automated_testing_framework_plugin_sqflite: ^1.0.1

Flutter Android iOS

Library to use SQLite Database as a storage mechanism for automated tests and test results.

example/lib/main.dart

import 'package:automated_testing_framework/automated_testing_framework.dart';
import 'package:automated_testing_framework_example/automated_testing_framework_example.dart';
import 'package:automated_testing_framework_plugin_sqflite/automated_testing_framework_plugin_sqflite.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as path;

void main() async {
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) {
    // ignore: avoid_print
    print('${record.level.name}: ${record.time}: ${record.message}');
    if (record.error != null) {
      // ignore: avoid_print
      print('${record.error}');
    }
    if (record.stackTrace != null) {
      // ignore: avoid_print
      print('${record.stackTrace}');
    }
  });

  WidgetsFlutterBinding.ensureInitialized();

  var databasesPath = await getDatabasesPath();
  var dbPath = path.join(databasesPath, 'test_db.db');

  final database = await openDatabase(
    dbPath,
  );

  var store = SqfliteTestStore(database: database);

  var gestures = TestableGestures();

  runApp(App(
    options: TestExampleOptions(
      autorun: kProfileMode,
      enabled: true,
      gestures: gestures,
      // testReader: AssetTestStore(
      //   testAssetIndex:
      //       'packages/automated_testing_framework_example/assets/all_tests.json',
      // ).testReader,
      testReader: store.testReader,
      testReporter: store.testReporter,
      testWidgetsEnabled: true,
      testWriter: store.testWriter,
    ),
  ));
}
0
likes
100
pub points
0%
popularity

Library to use SQLite Database as a storage mechanism for automated tests and test results.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

limonadev@gmail.com

License

MIT (LICENSE)

Dependencies

automated_testing_framework, convert, flutter, logging, meta, sqflite

More

Packages that depend on automated_testing_framework_plugin_sqflite