fail_then_pass_test_script.dart 905 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
// Copyright 2014 The Flutter 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 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

Future<void> main() async {
11
  final IntegrationTestWidgetsFlutterBinding binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() as IntegrationTestWidgetsFlutterBinding;
12
  binding.allTestsPassed.future.then((_) {
13 14
    // We use this print to communicate with ../binding_fail_test.dart
    // ignore: avoid_print
15 16 17 18 19 20 21 22 23 24 25
    print('IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}');
  });

  testWidgets('failing test', (WidgetTester tester) async {
    expect(true, false);
  });

  testWidgets('passing test', (WidgetTester tester) async {
    expect(true, true);
  });
}