Commit Graph

79 Commits

Author SHA1 Message Date
Dan Rubel
34e466f1fd Refactor flutter command exit code - part 3 of 3 (#6838)
* Remove the workaround that pinned args to v0.13.6
This reverts most of the changes in commit 6331b6c8b5
* throw exception if exit code is not an integer
* rework command infrastructure to throw ToolExit when non-zero exitCode
* convert commands to return Future<Null>
* cleanup remaining commands to use throwToolExit for non-zero exit code
* remove isUnusual exception message
* add type annotations for updated args package
2016-11-14 14:21:30 -05:00
Yegor
d63430773c add driver failure test (#6776) 2016-11-09 15:28:30 -08:00
Yegor
0cd69826f5 100% doc coverage in package:flutter_driver (#6738) 2016-11-08 15:30:31 -08:00
Dan Rubel
6331b6c8b5 revert args to 0.13.6 (#6765) 2016-11-08 17:15:11 -05:00
Adam Barth
67f591000f Mentions flutter packages get rather than pub get (#6625)
Fixes #6417
2016-11-01 13:27:06 -07:00
Yegor
33c6526462 fix frame info extraction logic; track frames in gallery test (#6505) 2016-10-25 11:02:18 -07:00
Chris Bracken
8b197bddce Fix common typos in doc comments (#6520) 2016-10-25 10:06:42 -07:00
Chris Bracken
441a62a402 Support an environment-specified VM service URL (#6497)
If a URL is not explicitly specified by the test author, check for an
environment-specified URL before falling back to the default value.
2016-10-24 12:36:48 -07:00
Yegor
995fcdc92b add description to by-predicate finders (#6362)
Add an option to provide a custom description to predicate
finders. Without a custom description we default to printing the
predicate function's signature, which is not all that useful.

Use this new option in the driver extension to print the text of the
sought after tooltip.
2016-10-17 17:16:22 -07:00
Adam Barth
9cab64a72c More automated edits of iml files 2016-10-14 21:57:28 -07:00
Adam Barth
9ae7f4903e Update IML files 2016-10-14 09:58:48 -07:00
Adam Barth
a6b5293df9 Update iml files (#6300)
These changes were generated by IntelliJ.
2016-10-12 23:33:17 -07:00
Devon Carew
4c8b7b5d44 commit intellij project metadata (#6232)
* commit intellij project metadata

* move metadata to the top level

* delete dev/intellij
2016-10-06 17:43:52 -07:00
Jason Simmons
4d8f4f421a Screenshot API for flutter driver (#6175) 2016-10-03 12:26:30 -07:00
Adam Barth
c1a2967430 Use SDK sources to refer to our own packages (#6001)
Switch our pubspec.yamls to using SDK sources so that we can have consistent
source types when we depend on these packages from external packages using SDK
sources.
2016-09-22 20:39:35 -07:00
Dan Rubel
3c467a899a cleanup unawaited futures lints (#5946) 2016-09-20 07:33:35 -04:00
Yegor
721cf95300 fix a race in tap gesture in the driver extension (#5853) 2016-09-13 14:54:12 -07:00
Adam Barth
157ffaac35 Update Dart package dependencies (#5832) 2016-09-12 16:00:12 -07:00
Yegor
b5a47d71cb driver: fix covariant closures; make them private (#5782) 2016-09-09 10:34:55 -07:00
Phil Quitslund
d2fda677e1 Update to Dart 1.20.0-dev.1.0. (#5689)
* Udpate to Dart `1.20.0-dev.1.0`.

Udpate to Dart `1.20.0-dev.1.0` and corresponding `analyzer` package.

* Added `--no-packages-dir`.

* Revert extension to master.

* Added ignores.

* Review nits.

* More nits.
2016-09-08 13:14:08 -07:00
pq
13c3f9d946 Update Dart (1.19.0-dev.0.0) and analyzer (0.27.4-alpha.19). 2016-07-27 10:44:44 -07:00
YoungSeok Yoon
a10cd03b05 Flutter driver commands for controlling the Input widget (#4913)
* Driver commands for controlling the Input widget

This commit introduces two new driver commands for controlling the
material Input widget.

* setInputText(SerializableFinder finder, String text)
* submitInputText(SerializableFinder finder)

Since it is not possible to directly modify the Input widget text,
these driver commands invokes the handler functions of the Input
widget: onChanged and onSubmitted, respectively. The `submitInputText`
command returns the submitted String as a result.

* Make input command handler methods private

Addressing comments from @yjbanov.
2016-07-14 13:29:49 -07:00
Kaiyuan Wang
ccf87bd083 Fix the issue that flutter driver does not close _peer (#4755)
* Fix the issue that flutter driver does not close _peer when
driver.close() is invoked.  The problem introduces the following
unexpected behavior:

  1. Launch an app using "flutter run ..." command
  2. Run the flutter driver test using "dart flutter_test.dart"

The test will not exit after running.  The problem will be solved
if _peer is closed.

* Fix formatting issue
2016-06-25 12:58:46 -07:00
Devon Carew
415324f2f0 bump our dep on the test package (#4625)
* bump out dep on the test package

* add other pubspecs
2016-06-19 08:10:03 -07:00
Devon Carew
49affc4098 make the drive output prettier (#4260) 2016-05-27 22:36:07 -07:00
Adam Barth
fde55a6f6a Update vector_math (#4201)
The new version has an API change. Also, up our SDK requirements to be a
bit more realistic.
2016-05-26 09:49:09 -07:00
Adam Barth
c69cff9428 Update test package (#4198) 2016-05-25 17:45:23 -07:00
Hans Muller
770f8f1d0c rename TracingCategory to TimelineStream (#3822) 2016-05-09 17:00:49 -07:00
pq
bcede8dffb Literals get type annotations.
As per the recent fix to the `always_specify_types` lint (https://github.com/dart-lang/linter/issues/199), literal maps and lists are now expected to be explicitly typed.

Running that lint on the repo identifies quite a few spots to update.  This focuses on `flutter_driver` and `flutter_sprites` (somewhat arbitrarily) but the changes are fairly representative.

Note there are a number of places where I made a quick judgement on how specific to make the types.  Feedback on those is welcome.  (Especially as we move forward with more.)
2016-05-04 09:18:31 -07:00
Hans Muller
a9b965cb9b Gallery demo start-time performance test (#3655)
*  Gallery demo start-time performance test
2016-05-03 17:37:10 -07:00
Ian Hickson
4b401a3e75 Track the worst frame in perf tests (#3642)
* Track the worst frame in perf tests

* Use backticks in "/// Returns `null` if"
2016-05-03 14:00:10 -07:00
Devon Carew
c9010c91f6 fix analysis errors (#3677)
* fix analysis errors

* review comments; fix test

* re-add an export for debugPrint
2016-05-03 09:09:00 -07:00
Ian Hickson
91dd969966 Refactor the test framework (#3622)
* Refactor widget test framework

Instead of:

```dart
  test("Card Collection smoke test", () {
    testWidgets((WidgetTester tester) {
```

...you now say:

```dart
  testWidgets("Card Collection smoke test", (WidgetTester tester) {
```

Instead of:

```dart
  expect(tester, hasWidget(find.text('hello')));
```

...you now say:

```dart
  expect(find.text('hello'), findsOneWidget);
```

Instead of the previous API (exists, widgets, widget, stateOf,
elementOf, etc), you now have the following comprehensive API. All these
are functions that take a Finder, except the all* properties.

* `any()` - true if anything matches, c.f. `Iterable.any`
* `allWidgets` - all the widgets in the tree
* `widget()` - the one and only widget that matches the finder
* `firstWidget()` - the first widget that matches the finder
* `allElements` - all the elements in the tree
* `element()` - the one and only element that matches the finder
* `firstElement()` - the first element that matches the finder
* `allStates` - all the `State`s in the tree
* `state()` - the one and only state that matches the finder
* `firstState()` - the first state that matches the finder
* `allRenderObjects` - all the render objects in the tree
* `renderObject()` - the one and only render object that matches the finder
* `firstRenderObject()` - the first render object that matches the finder

There's also `layers' which returns the list of current layers.

`tap`, `fling`, getCenter, getSize, etc, take Finders, like the APIs
above, and expect there to only be one matching widget.

The finders are:

 * `find.text(String text)`
 * `find.widgetWithText(Type widgetType, String text)`
 * `find.byKey(Key key)`
 * `find.byType(Type type)`
 * `find.byElementType(Type type)`
 * `find.byConfig(Widget config)`
 * `find.byWidgetPredicate(WidgetPredicate predicate)`
 * `find.byElementPredicate(ElementPredicate predicate)`

The matchers (for `expect`) are:

 * `findsNothing`
 * `findsWidgets`
 * `findsOneWidget`
 * `findsNWidgets(n)`
 * `isOnStage`
 * `isOffStage`
 * `isInCard`
 * `isNotInCard`

Benchmarks now use benchmarkWidgets instead of testWidgets.

Also, for those of you using mockers, `serviceMocker` now automatically
handles the binding initialization.

This patch also:

* changes how tests are run so that we can more easily swap the logic
  out for a "real" mode instead of FakeAsync.

* introduces CachingIterable.

* changes how flutter_driver interacts with the widget tree to use the
  aforementioned new API rather than ElementTreeTester, which is gone.

* removes ElementTreeTester.

* changes the semantics of a test for scrollables because we couldn't
  convince ourselves that the old semantics made sense; it only worked
  before because flushing the microtasks after every event was broken.

* fixes the flushing of microtasks after every event.

* Reindent the tests

* Fix review comments
2016-04-29 13:23:27 -07:00
Devon Carew
50b1b16db6 rev test to 0.12.13+1 to support 1.17.0-dev dart sdks (#3613) 2016-04-28 12:56:55 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00
Ian Hickson
0e11b0e6e3 Make the widgets binding reusable. (#3479)
Previously the widgets layer only provided a concrete binding, which
makes it awkward to extend it compared to other bindings. This moves
widgets to the same style as the other layers.

In a subsequent patch I'll use this to make the tests layer saner.
2016-04-21 16:06:51 -07:00
Ian Hickson
b7af64ee50 Refactor TestGesture (#3461)
Moves TestGesture into test_pointer.dart and makes it more
self-contained.

This is part of a general refactoring of flutter_test.

Depends on https://github.com/flutter/flutter/pull/3459
2016-04-21 13:18:02 -07:00
Yegor
7fe7de3f12 [driver] fix a race in finder logic (#3444) 2016-04-20 15:26:09 -07:00
Ian Hickson
261923e5c6 Refactor service extensions (#3397)
Bindings now have a debugRegisterServiceExtensions() method that is
invoked in debug mode (only). (Once we have a profile mode, there'll be
a registerProfileServiceExtensions() method that gets called in that
mode only to register extensions that apply then.)

The BindingBase class provides convenience methods for registering
service extensions that do the equivalent of:

```dart
void extension() { ... }
bool extension([bool enabled]) { ... }
double extension([double extension])  { ... }
Map<String, String> extension([Map<String, String> parameters]) { ... }
```

The BindingBase class also itself registers ext.flutter.reassemble,
which it has call a function on the binding called
reassembleApplication().

The Scheduler binding now exposes the preexisting
ext.flutter.timeDilation.

The Renderer binding now exposes the preexisting ext.flutter.debugPaint.

The Renderer binding hooks reassembleApplication to trigger the
rendering tree to be reprocessed (in particular, to fix up the
optimisation closures).

All the logic from rendering/debug.dart about service extensions is
replaced by the above.

I moved basic_types to foundation.

The FlutterWidgets binding hooks reassembleApplication to trigger the
widget tree to be entirely rebuilt.

Flutter Driver now uses ext.flutter.driver instead of
ext.flutter_driver, and is hooked using the same binding mechanism.
Eventually we'll probably move the logic into the Flutter library so
that you just get it without having to invoke a special method first.
2016-04-19 10:53:58 -07:00
Yegor
e7657b9462 [driver] "waitFor" command in place of broken "exists" (#3373)
* [driver] "waitFor" command in place of broken "exits"

* [driver] wait using frame callback
2016-04-19 09:49:22 -07:00
Yegor
9ce995f65e [driver] refactor API to finder objects (#3365) 2016-04-15 16:57:35 -07:00
Yegor
0e9737e4cc [driver] upgrade to the latest version of vm_service_client (#3348) 2016-04-14 23:23:45 -07:00
Yegor
86597cd10d [driver] lock vm_service_client
until we have a fix for the breaking changes
2016-04-14 16:26:17 -07:00
Yegor
d5d4e7c054 [driver] output per-frame build times in the timeline summary (#3334) 2016-04-14 11:28:16 -07:00
Eric Seidel
341bd47624 Move flutter drive to use 8183 to not conflict with diagnostic server
When @jason-simons added the diagnostic server on Android this
happened to conflict with flutter drive's usage of 8182.

We really should fix both of these port users to be dynamic
but this fixes https://github.com/flutter/flutter/issues/3291
for now.

@yjbanov
2016-04-13 11:22:38 -07:00
Seth Ladd
f43e1dfaff Fix instruction when app is missing enableFlutterDriverExtension (#3239) 2016-04-11 09:17:51 -07:00
Seth Ladd
3e661965c2 de-dupe API docs in flutter_driver (#3240) 2016-04-11 09:11:32 -07:00
Yegor
99e916d0e2 [driver] fix analyzer warnings in the extension (#3205) 2016-04-07 17:33:17 -07:00
Yegor
f697f58ccd [driver] fix match state hand-off in matcher_util.dart (#3103)
Fixes https://github.com/flutter/flutter/issues/3094
2016-04-07 10:08:14 -07:00
Yegor
19e624ccfe [driver] give the timeline data some structure
Fixes https://github.com/flutter/flutter/issues/2713
2016-04-04 17:07:16 -07:00