Skip to content

Commit

Permalink
Chore/update v0.3.2 (#99)
Browse files Browse the repository at this point in the history
* maestro_test: set version to 0.3.2

* maestro_cli: set version to 0.3.2

* make it possible to pass `--dart-define`s through CLI
  • Loading branch information
bartekpacia authored Jul 6, 2022
1 parent f5d7d7c commit 5b2e432
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 63 deletions.
2 changes: 1 addition & 1 deletion AutomatorServer/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
minSdkVersion 26
targetSdkVersion 31
versionCode 1
versionName "0.3.1"
versionName "0.3.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
46 changes: 26 additions & 20 deletions packages/maestro_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
## 0.3.2

- Fix a crash which occured when ADB daemon was not initialized
- Make it possible to add `--dart-define`s in `maestro.toml`
- Fix templates generated by `maestro bootstrap`

## 0.3.1

- Automatically inform about new version when it is available.
- Add `maestro update` command to easily update the package.
- Automatically inform about new version when it is available
- Add `maestro update` command to easily update the package

## 0.3.0

Expand All @@ -15,24 +21,24 @@

## 0.1.5

- Allow for running on many devices simultaneously.
- A usual portion of smaller improvements and bug fixes.
- Allow for running on many devices simultaneously
- A usual portion of smaller improvements and bug fixes

## 0.1.4

- Be more noisy when an error occurs.
- Change waiting timeout for native widgets from 10s to 2s.
- Be more noisy when an error occurs
- Change waiting timeout for native widgets from 10s to 2s

## 0.1.3

- Fix a bug which made `flavor` option required.
- Fix a bug which made `flavor` option required
- Add `--debug` flag to `maestro drive`, which allows to use default,
non-versioned artifacts from `$MAESTRO_ARTIFACT_PATH`.
non-versioned artifacts from `$MAESTRO_ARTIFACT_PATH`

## 0.1.2

- Fix typo in generated `integration_test/app_test.dart`.
- Depend on [package:adb](https://pub.dev/packages/adb).
- Fix typo in generated `integration_test/app_test.dart`
- Depend on [package:adb](https://pub.dev/packages/adb)

## 0.1.1

Expand All @@ -48,37 +54,37 @@
## 0.0.9

- Add `--device` option for `maestro drive`, which allows you to specify the
device to use. Devices can be obtained using `adb devices`.
device to use. Devices can be obtained using `adb devices`

## 0.0.8

- Fix `maestro drive` on Windows crashing with ProcessException.
- Fix `maestro drive` on Windows crashing with ProcessException

## 0.0.7

- Fix a few bugs.
- Fix a few bugs

## 0.0.6

- Fix `maestro bootstrap` on Windows crashing with ProcessException.
- Fix `maestro bootstrap` on Windows crashing with ProcessException

## 0.0.5

- Make versions match AutomatorServer.
- Make versions match AutomatorServer

## 0.0.4

- Nothing.
- Nothing

## 0.0.3

- Add support for `maestro.toml` config file.
- Add support for `maestro.toml` config file

## 0.0.2

- Split `maestro` and `maestro_cli` into separate packages.
- Add basic, working command line interface with.
- Split `maestro` and `maestro_cli` into separate packages
- Add basic, working command line interface with

## 0.0.1

- Initial version.
- Initial version
14 changes: 4 additions & 10 deletions packages/maestro_cli/lib/src/command_runner.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:adb/adb.dart';
import 'package:args/command_runner.dart';
import 'package:maestro_cli/src/common/common.dart';
import 'package:maestro_cli/src/features/bootstrap/bootstrap_command.dart';
Expand All @@ -11,12 +10,7 @@ import 'package:maestro_cli/src/features/update/update_command.dart';
import 'package:pub_updater/pub_updater.dart';

Future<int> maestroCommandRunner(List<String> args) async {
// TODO: Move this initalization to a better place.
final adb = Adb();
await adb.init();
final devices = await adb.devices();

final runner = MaestroCommandRunner(devices: devices);
final runner = MaestroCommandRunner();

try {
final exitCode = await runner.run(args) ?? 0;
Expand All @@ -40,13 +34,13 @@ bool debugFlag = false;
bool verboseFlag = false;

class MaestroCommandRunner extends CommandRunner<int> {
MaestroCommandRunner({required List<String> devices})
MaestroCommandRunner()
: super(
'maestro',
'Tool for running Flutter-native UI tests with superpowers',
) {
addCommand(BootstrapCommand());
addCommand(DriveCommand(devices));
addCommand(DriveCommand());
addCommand(DoctorCommand());
addCommand(CleanCommand());
addCommand(UpdateCommand());
Expand Down Expand Up @@ -126,7 +120,7 @@ Future<void> _checkIfUsingLatestVersion() async {
currentVersion: version,
);

if (!isLatestVersion) {
if (!isLatestVersion && !debugFlag) {
log
..info(
'Newer version of $maestroCliPackage is available ($latestVersion)',
Expand Down
2 changes: 1 addition & 1 deletion packages/maestro_cli/lib/src/common/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Version of Maestro CLI. Must be kept in sync with pubspec.yaml.
const version = '0.3.1';
const version = '0.3.2';

const maestroPackage = 'maestro_test';
const maestroCliPackage = 'maestro_cli';
Expand Down
27 changes: 24 additions & 3 deletions packages/maestro_cli/lib/src/features/drive/drive_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:maestro_cli/src/features/drive/flutter_driver.dart'
import 'package:maestro_cli/src/maestro_config.dart';

class DriveCommand extends Command<int> {
DriveCommand(List<String> devices) {
DriveCommand() {
argParser
..addOption(
'host',
Expand Down Expand Up @@ -38,7 +38,14 @@ class DriveCommand extends Command<int> {
..addMultiOption(
'devices',
help: 'List of devices to drive the app on.',
allowed: ['all', ...devices],
valueHelp: 'all, emulator-5554',
)
..addMultiOption(
'dart-define',
help:
'List of additional key-value pairs that will be available to the '
'app under test.',
valueHelp: 'SOME_VAR=SOME_VALUE',
)
..addFlag(
'parallel',
Expand Down Expand Up @@ -93,9 +100,23 @@ class DriveCommand extends Command<int> {
}

final dartDefines = config.driveConfig.dartDefines ?? {};
final dynamic cliDartDefines = argResults?['dart-define'];
if (cliDartDefines != null && cliDartDefines is! List<String>) {
throw FormatException(
'`dart-define` argument $cliDartDefines is not a list',
);
}

for (final entry in cliDartDefines as List<String>) {
final split = entry.split('=');
if (split.length != 2) {
throw FormatException('`dart-define` value $split is not valid');
}
dartDefines[split[0]] = split[1];
}

for (final dartDefine in dartDefines.entries) {
log.info('dartDefine: ${dartDefine.key}=${dartDefine.value}');
log.info('Passed --dart--define: ${dartDefine.key}=${dartDefine.value}');
}

final devicesArg = argResults?['devices'] as List<String>?;
Expand Down
4 changes: 2 additions & 2 deletions packages/maestro_cli/lib/src/features/drive/drive_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class DriveConfig {
target: target,
driver: driver,
flavor: flavor as String?,
dartDefines: (dartDefines as Map<String, dynamic>)
.map((key, dynamic value) => MapEntry(key, value.toString())),
dartDefines: (dartDefines as Map<String, dynamic>?)
?.map((key, dynamic value) => MapEntry(key, value.toString())),
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/maestro_cli/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: maestro_cli
description: CLI for Maestro.
version: 0.3.1
version: 0.3.2
homepage: https://github.com/leancodepl/maestro

environment:
Expand Down
52 changes: 32 additions & 20 deletions packages/maestro_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
## 0.3.2

- Improve selector engine:

- Make it possible to pass a `Key` as `matching` to
`MaestroTester.call(dynamic matching)` and `MaestroFinder.$(dynamic matching)`

- Add `sleep` parameter for `maestroTest` method
- Make `WidgetTester`'s forwarded methods in `MaestroTester` accept less
arguments
- Add more in-code documentation

## 0.3.1

- Improve selector engine:

- Make it possible to pass a `MaestroFinder` as `expression` to
`MaestroTester.call(dynamic expression)` and `MaestroFinder.$(dynamic expression)`
- Fix a bug which caused chaining expressions (e.g
- Make it possible to pass a `MaestroFinder` as `matching` to
`MaestroTester.call(dynamic matching)` and `MaestroFinder.$(dynamic matching)`
- Fix a bug which caused chaining `MaestroFinder`s (e.g
`$(Scaffold).$(Container).$(#someText)`) to not work.

- Add more in-code documentation and improve README.
- Add more in-code documentation and improve README

## 0.3.0

Expand All @@ -26,56 +38,56 @@

- Make `Maestro.forTest()` automatically call
`IntegrationTestWidgetsFlutterBinding.ensureInitialized()`
- Fix many smaller issues.
- Fix many smaller issues

## 0.1.4

- Allow for running on many devices simultaneously.
- Rename class `Automator` to `Maestro`.
- Simpified test-side initialization. Now all you need is `Maestro.forTest()`.
- Allow for running on many devices simultaneously
- Rename class `Automator` to `Maestro`
- Simpified test-side initialization. Now all you need is `Maestro.forTest()`
- Simpified driver-side initialization. Now all you need is
`Maestro.forDriver()`.
`Maestro.forDriver()`

## 0.1.3

- Add support for enabling/disabling Bluetooth.
- Add support for enabling/disabling Bluetooth

## 0.1.2

- Be more noisy when an error occurs.
- Be more noisy when an error occurs

## 0.1.1

- Fix minor logging bug.
- Fix minor logging bug

## 0.1.0

- Add basic means of controlling platform-native Widgets (`TextView`,
`EditText`, and `Button` on Android). This also applies to WebView.
- Add enabling and disabling of Wi-Fi, Celluar, and Night Mode.
- Improve stability.
- Add enabling and disabling of Wi-Fi, Celluar, and Night Mode
- Improve stability

## 0.0.6

- Set minimum Dart version to 2.16.
- Fix links to `package:leancode_lint` in README.
- Set minimum Dart version to 2.16
- Fix links to `package:leancode_lint` in README

## 0.0.5

- Update broken link in README.

## 0.0.4

- Update README.
- Update README

## 0.0.3

- Rename from `maestro` to `maestro_test`.
- Rename from `maestro` to `maestro_test`

## 0.0.2

- Split `maestro` and `maestro_cli` into separate packages.
- Split `maestro` and `maestro_cli` into separate packages

## 0.0.1

- Initial version.
- Initial version
8 changes: 4 additions & 4 deletions packages/maestro_test/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# maestro_test

[![maestro_test on pub.dev][pub_badge]][pub_link] [![code
style][pub_badge_style]][pub_badge_link]
[![maestro_test on pub.dev][pub_badge]][pub_link]
[![codestyle][pub_badge_style]][pub_badge_link]

`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
Expand All @@ -16,10 +16,10 @@ Add `maestro_test` as a dev dependency in `pubspec.yaml`:

```
dev_dependencies:
maestro_test: ^0.3.1
maestro_test: ^0.3.2
```

### Using features of the underlying native platform
### Accessing native platform features

```dart
// example/integration_test/example_test.dart
Expand Down
2 changes: 1 addition & 1 deletion packages/maestro_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: maestro_test
description: >
Simple, easy-to-learn, Flutter-native UI testing framework eliminating
limitations of flutter_driver
version: 0.3.1
version: 0.3.2
homepage: https://github.com/leancodepl/maestro/tree/master/packages/maestro_test

environment:
Expand Down

0 comments on commit 5b2e432

Please sign in to comment.