[integration_test] Add a run method for proper reporting of test results (#70075)

This commit is contained in:
Jia Hao
2020-11-13 19:57:15 +08:00
committed by GitHub
parent 7cda6866b0
commit af5eb3b987
20 changed files with 481 additions and 170 deletions

View File

@@ -1,4 +0,0 @@
Files in this directory are not invoked directly by the test command.
They are used as inputs for the other test files outside of this directory, so
that failures can be tested.

View File

@@ -1,24 +0,0 @@
// 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:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> main() async {
final IntegrationTestWidgetsFlutterBinding binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() as IntegrationTestWidgetsFlutterBinding;
testWidgets('failing test 1', (WidgetTester tester) async {
expect(true, false);
});
testWidgets('failing test 2', (WidgetTester tester) async {
expect(true, false);
});
tearDownAll(() {
print('IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}');
});
}

View File

@@ -1,25 +0,0 @@
// 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:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> main() async {
final IntegrationTestWidgetsFlutterBinding binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() as IntegrationTestWidgetsFlutterBinding;
testWidgets('passing test 1', (WidgetTester tester) async {
expect(true, true);
});
testWidgets('passing test 2', (WidgetTester tester) async {
expect(true, true);
});
tearDownAll(() {
print(
'IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}');
});
}

View File

@@ -1,25 +0,0 @@
// 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:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> main() async {
final IntegrationTestWidgetsFlutterBinding binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() as IntegrationTestWidgetsFlutterBinding;
testWidgets('passing test', (WidgetTester tester) async {
expect(true, true);
});
testWidgets('failing test', (WidgetTester tester) async {
expect(true, false);
});
tearDownAll(() {
print(
'IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}');
});
}