Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Jun 7, 2022
1 parent ed2bb3a commit fcf83f0
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $ maestro drive

## Package

The `maestro_test` package builds on top of `flutter_driver` to make it easy to
`maestro_test` package builds on top of `flutter_driver` to make it easy to
control the native device. It does this by using Android's
[UIAutomator][ui_automator] library.

Expand Down
74 changes: 57 additions & 17 deletions packages/maestro_test/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,68 @@
# maestro_test

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
[![maestro_test on pub.dev][pub_badge]][pub_link]
[![code style][pub_badge_style]][pub_badge_link]

## Features
`maestro_test` package builds on top of `flutter_driver` to make it easy to
control the native device from Dart. It does this by using Android's
[UIAutomator][ui_automator] library.

TODO: List what your package can do. Maybe include images, gifs, or videos.
### Installation

## Getting started
Add `maestro_test` as a dev dependency in `pubspec.yaml`:

TODO: List prerequisites and provide or point to information on how to
start using the package.

## Usage
```
dev_dependencies:
maestro_test: ^0.0.3
```

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
### Usage

```dart
const like = 'sample';
```
// integration_test/app_test.dart
import 'package:example/app.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:maestro_test/maestro_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Automator.init(verbose: true);
final automator = Automator.instance;
testWidgets(
"counter state is the same after going to Home and switching apps",
(WidgetTester tester) async {
Text findCounterText() {
return tester
.firstElement(find.byKey(const ValueKey('counterText')))
.widget as Text;
}
await tester.pumpWidget(const MyApp());
await tester.pumpAndSettle();
## Additional information
await tester.tap(find.byType(FloatingActionButton));
await tester.pumpAndSettle();
expect(findCounterText().data, '1');
await automator.pressHome();
await automator.pressDoubleRecentApps();
expect(findCounterText().data, '1');
await tester.tap(find.byType(FloatingActionButton));
await tester.pumpAndSettle();
expect(findCounterText().data, '2');
await automator.openNotifications();
},
);
}
```

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
[pub_badge]: https://img.shields.io/pub/v/maestro_test.svg
[pub_link]: https://pub.dartlang.org/packages/maestro_test
[pub_badge_style]: https://img.shields.io/badge/style-leancode__lint-black
[pub_badge_link]: https://pub.dartlang.org/packages/lean_code_lint

0 comments on commit fcf83f0

Please sign in to comment.