driver_extensions 1.2.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

driver_extensions #

pub package

A set of Flutter Driver extension methods to make driver tests easier to write and maintain.

Reasoning #

When Flutter driver tests fail, we have not detailed enough message:

await driver.waitFor(
  find.byValueKey('missing'),
);

With the extensions, you will get this message:

await driver.waitForElement(
  find.byValueKey('missing'),
);

1.2.0+1 #

  • Some renaming

1.2.0 #

  • Exposing currentTestFile method that returns current test file name

1.1.0 #

  • Adding callback onTimeout to invoke code when driver operation failed with a timeout

1.0.1 #

  • Updating API's documentation

1.0.0+1 #

  • Updating package description

1.0.0 #

  • Initial Release

example/lib/main.dart

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              //TODO(tomek) change when it's in stable channel
              // ignore: deprecated_member_use
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        key: const Key('increment'),
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  driver_extensions: ^1.2.0+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:driver_extensions/driver_extensions.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • driver_extensions that is a package requiring null.

Package not compatible with runtime flutter-web on web

Because:

  • package:driver_extensions/driver_extensions.dart that imports:
  • package:driver_extensions/src/extensions.dart that imports:
  • package:flutter_driver/flutter_driver.dart that imports:
  • package:flutter_driver/src/driver/timeline_summary.dart that imports:
  • package:flutter_driver/src/driver/common.dart that imports:
  • package:file/memory.dart that imports:
  • package:file/src/backends/memory.dart that imports:
  • package:file/src/backends/memory/style.dart that imports:
  • package:file/file.dart that imports:
  • package:file/src/interface.dart that imports:
  • package:file/src/io.dart that imports:
  • dart:io

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
colorize ^2.0.0 2.0.0
flutter 0.0.0
flutter_driver 0.0.0
meta ^1.1.8 1.1.8 1.2.2
Transitive dependencies
archive 2.0.13
args 1.6.0
async 2.4.1 2.4.2
boolean_selector 2.0.0
charcode 1.1.3
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.4 2.1.5
file 5.1.0 5.2.1
fuchsia_remote_debug_protocol 0.0.0
image 2.1.12 2.1.14
intl 0.16.1
json_rpc_2 2.1.0 2.2.1
matcher 0.12.6 0.12.8
path 1.6.4 1.7.0
petitparser 2.4.0 3.0.4
platform 2.2.1
process 3.0.12 3.0.13
pub_semver 1.4.4
quiver 2.1.3
sky_engine 0.0.99
source_span 1.7.0
stream_channel 2.0.0
string_scanner 1.0.5
sync_http 0.2.0
term_glyph 1.1.0
test_api 0.2.15 0.2.17
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
vm_service_client 0.2.6+2 0.2.6+3
web_socket_channel 1.1.0
webdriver 2.1.2
xml 3.6.1 4.2.0
Dev dependencies
fast_flutter_driver ^0.1.1+2
flutter_test 0.0.0
stack_trace ^1.9.3 1.9.3 1.9.5
test ^1.9.4