Skip to content

Extension finders for FlutterDriverExtension #62299

@marcin-jelenski

Description

@marcin-jelenski

Use case

Flutter driver exposes only a subset of finders available in flutter "widget tests". To mention some SerializableFinders: ByText, ByText, ByType etc.

There're cases where we need a "first element" or wait for an element which can't be described using existing finders. Also, there're some open GitHub issues which seems related:

#62106
#18445

There's an option to add a custom data handler and write interaction manually:

enableFlutterDriverExtension(
    handler: (request) async {
       // custom handler with flutter_test
    }
  );

Using data handler seems not as a most elegant solution though. Also, this method doesn't reuse waitFor nor waitForAbsent methods.

Proposal

Let's make FlutterDriverExtension::_finders field public (or add a method), so anyone can add a custom SerializableFinder, read it's parameters and connect with flutter tests finder:

https://github.com/flutter/flutter/blob/master/packages/flutter_driver/lib/src/extension/extension.dart#L164

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions