hrk_flutter_test_batteries 0.2.0 copy "hrk_flutter_test_batteries: ^0.2.0" to clipboard
hrk_flutter_test_batteries: ^0.2.0 copied to clipboard

A library to accumulate required flutter test helper and utility codes

ci codecov pub package

A library to accumulate required flutter test helper and utility codes

Features #

  • getTestType()
  • simulateAndroidBackButton(tester)
  • verifySystemNavigatorPop(tester)

Getting started #

flutter pub add dev:hrk_flutter_test_batteries

Usage #

import 'package:flutter_test/flutter_test.dart';
import 'package:hrk_flutter_test_batteries/hrk_flutter_test_batteries.dart';

void main() {
  test('$getTestType() Test', () {
    // To know whether in Widget Test or Integration Test.
    // For commands
    //   - flutter test
    //   - flutter test integration_test
    //   - flutter driver
  });

  testWidgets('Simulate Android Back Button', (tester) async {
    // await tester.pumpWidget(deep-link code);
    simulateAndroidBackButton(tester);
    // expect(find.byType(HomeScreen), findsOneWidget);
  });

  testWidgets('Pump app and press back', (tester) async {
    // await pumpApp(tester);
    await verifySystemNavigatorPop(tester);
    // To verify pressing back button, leaves the app
  });
}

3
likes
0
points
7.69k
downloads

Publisher

verified publisherhrishikesh-kadam.dev

Weekly Downloads

A library to accumulate required flutter test helper and utility codes

Repository (GitHub)
View/report issues

Topics

#batteries #flutter-batteries #flutter-test-batteries

License

unknown (license)

Dependencies

flutter, flutter_test, integration_test

More

Packages that depend on hrk_flutter_test_batteries