main_test.dart 962 Bytes
Newer Older
1 2 3 4 5
// Copyright 2018 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:async';
6
import 'dart:io' show Platform;
7
import 'package:flutter_driver/flutter_driver.dart';
8
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
9 10

Future<void> main() async {
11
  FlutterDriver driver;
12

13 14 15 16 17 18
  setUpAll(() async {
    driver = await FlutterDriver.connect();
  });

  tearDownAll(() {
    driver.close();
19 20
  });

21 22 23 24 25 26 27 28 29 30 31 32 33
  group('MotionEvents tests ', () {
    test('recomposition', () async {
      if (Platform.isAndroid) {
        final SerializableFinder motionEventsListTile =
        find.byValueKey('MotionEventsListTile');
        await driver.tap(motionEventsListTile);
        await driver.waitFor(find.byValueKey('PlatformView'));
        final String errorMessage = await driver.requestData('run test');
        expect(errorMessage, '');
      }
    });
  });
}