Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To run an example, run the `flutter run` command from the `example` directory of
directory. For example, for `sensors_plus` example:

```bash
cd packages/sensors_plus/sensors_plus/example
cd packages/sensors_plus/example
flutter run
```

Expand All @@ -75,25 +75,27 @@ interact with 3rd party services, and mock where possible. To run unit tests for
with the following commands:

```bash
cd packages/sensors_plus/sensors_plus_platform_interface
cd packages/sensors_plus
flutter test
```

### End-to-end (e2e) tests

E2e tests are those which directly communicate with Flutter, whose results cannot be mocked. These tests run directly from
an example application. To run e2e tests, run the `flutter drive` command from the plugins main `example` directory, targeting the
E2e tests are those which directly communicate with Flutter, whose results cannot be mocked. **These tests run directly from
an example application.**

To run e2e tests, run the `flutter drive` command from the plugins main `example` directory, targeting the
entry e2e test file.

```bash
cd packages/sensors_plus/sensors_plus/example
cd packages/sensors_plus/example
flutter drive --target=./test_driver/sensors_plus_e2e.dart
```

To run tests against web environments, run the command as a release build:

```bash
cd packages/sensors_plus/sensors_plus/example
cd packages/sensors_plus/example
flutter drive --target=./test_driver/sensors_plus_e2e.dart --release -d chrome
```

Expand Down
1 change: 1 addition & 0 deletions packages/battery_plus/test/battery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void main() {
tearDown(() {
controller.close();
});

test('receive values', () async {
final StreamQueue<BatteryState> queue =
StreamQueue<BatteryState>(battery.onBatteryStateChanged);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:convert';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';

Future<void> main() async {
final FlutterDriver driver = await FlutterDriver.connect();
final String data =
await driver.requestData(null, timeout: const Duration(minutes: 1));
await driver.close();
final Map<String, dynamic> result = jsonDecode(data);
exit(result['result'] == 'true' ? 0 : 1);
}
41 changes: 0 additions & 41 deletions packages/connectivity_plus/test/connectivity_e2e.dart

This file was deleted.