-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for specifying a particular device to use (#53)
* implement "--device" option for command "maestro drive" * set version to 0.0.9 * improve READMEs
- Loading branch information
1 parent
c3fd3ad
commit e010962
Showing
10 changed files
with
145 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |