From 8e05e59c29a2c534c7dc6b5465e58b8bb8d985f1 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 3 Dec 2020 09:54:28 -0600 Subject: [PATCH] Revert "Add integration_test template to create template (#70240)" (#71660) This reverts commit d047d108ebb08f1a26f19e0d8966d99a1dd49b73. --- .../app/integration_test/app_test.dart.tmpl | 48 -------------- .../app/integration_test/driver.dart.tmpl | 8 --- .../templates/app/pubspec.yaml.tmpl | 2 - .../templates/template_manifest.json | 2 - .../commands.shard/permeable/create_test.dart | 4 -- .../integration_test_test.dart | 62 ------------------- 6 files changed, 126 deletions(-) delete mode 100644 packages/flutter_tools/templates/app/integration_test/app_test.dart.tmpl delete mode 100644 packages/flutter_tools/templates/app/integration_test/driver.dart.tmpl delete mode 100644 packages/flutter_tools/test/integration.shard/integration_test_test.dart diff --git a/packages/flutter_tools/templates/app/integration_test/app_test.dart.tmpl b/packages/flutter_tools/templates/app/integration_test/app_test.dart.tmpl deleted file mode 100644 index 8c9c256e2a..0000000000 --- a/packages/flutter_tools/templates/app/integration_test/app_test.dart.tmpl +++ /dev/null @@ -1,48 +0,0 @@ -// This is a basic Flutter integration test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -import 'package:{{projectName}}/main.dart' as app; - -void main() => run(_testMain); - -void _testMain() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - app.main(); - - // Trigger a frame. - await tester.pumpAndSettle(); - -{{^withPluginHook}} - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); -{{/withPluginHook}} -{{#withPluginHook}} - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data.startsWith('Running on:'), - ), - findsOneWidget, - ); -{{/withPluginHook}} - }); -} diff --git a/packages/flutter_tools/templates/app/integration_test/driver.dart.tmpl b/packages/flutter_tools/templates/app/integration_test/driver.dart.tmpl deleted file mode 100644 index a03bca081a..0000000000 --- a/packages/flutter_tools/templates/app/integration_test/driver.dart.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -// This file is provided as a convenience for running integration tests via the -// flutter drive command. -// -// flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart - -import 'package:integration_test/integration_test_driver.dart'; - -Future main() => integrationDriver(); diff --git a/packages/flutter_tools/templates/app/pubspec.yaml.tmpl b/packages/flutter_tools/templates/app/pubspec.yaml.tmpl index 1a21e5c979..6baf34f6e7 100644 --- a/packages/flutter_tools/templates/app/pubspec.yaml.tmpl +++ b/packages/flutter_tools/templates/app/pubspec.yaml.tmpl @@ -43,8 +43,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - integration_test: - sdk: flutter # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/flutter_tools/templates/template_manifest.json b/packages/flutter_tools/templates/template_manifest.json index d5c7097335..80aa2dc115 100644 --- a/packages/flutter_tools/templates/template_manifest.json +++ b/packages/flutter_tools/templates/template_manifest.json @@ -33,8 +33,6 @@ "templates/app/android.tmpl/gradle/wrapper/gradle-wrapper.properties", "templates/app/android.tmpl/gradle.properties.tmpl", "templates/app/android.tmpl/settings.gradle", - "templates/app/integration_test/app_test.dart.tmpl", - "templates/app/integration_test/driver.dart.tmpl", "templates/app/ios-objc.tmpl/Runner/AppDelegate.h", "templates/app/ios-objc.tmpl/Runner/AppDelegate.m", "templates/app/ios-objc.tmpl/Runner/main.m", diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index d889368d2a..e7decaaab8 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -299,8 +299,6 @@ void main() { 'ios/Runner/main.m', 'lib/main.dart', 'test/widget_test.dart', - 'integration_test/app_test.dart', - 'integration_test/driver.dart', ], ); }, overrides: { @@ -366,8 +364,6 @@ void main() { 'ios/Runner/main.m', 'lib/main.dart', 'test/widget_test.dart', - 'integration_test/app_test.dart', - 'integration_test/driver.dart', ], ); return _runFlutterTest(projectDir); diff --git a/packages/flutter_tools/test/integration.shard/integration_test_test.dart b/packages/flutter_tools/test/integration.shard/integration_test_test.dart deleted file mode 100644 index 3016907f05..0000000000 --- a/packages/flutter_tools/test/integration.shard/integration_test_test.dart +++ /dev/null @@ -1,62 +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 'package:flutter_tools/src/base/file_system.dart'; -import 'package:flutter_tools/src/base/io.dart'; - -import '../src/common.dart'; -import 'test_utils.dart'; - -final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', platform.isWindows ? 'flutter.bat' : 'flutter'); - -void main() { - Directory tempDir; - setUpAll(() { - tempDir = createResolvedTempDirectorySync('int_test.'); - }); - - tearDownAll(() { - tryToDelete(tempDir); - }); - - testWithoutContext('flutter project default integration_test smoke test', () async { - const String projectName = 'integration_test_sample'; - ProcessResult result = await processManager.run( - [ - flutterBin, - 'create', - projectName, - ], - workingDirectory: tempDir.path, - ); - - expect(result.exitCode, 0); - - final Directory projectDir = tempDir.childDirectory(projectName); - expect(projectDir.existsSync(), true); - final Directory integrationTestDir = projectDir.childDirectory('integration_test'); - expect(integrationTestDir.existsSync(), true); - expect(integrationTestDir.childFile('driver.dart').existsSync(), true); - expect(integrationTestDir.childFile('app_test.dart').existsSync(), true); - - result = await processManager.run( - [ - flutterBin, - 'drive', - '-d', 'flutter-tester', - '--driver', 'integration_test/driver.dart', - '-t', 'integration_test/app_test.dart', - ], - workingDirectory: projectDir.path, - ); - - if (result.exitCode != 0) { - print('================================= STDOUT ======================================='); - print(result.stdout); - print('================================= STDERR ======================================='); - print(result.stderr); - fail('flutter drive failed, see output.'); - } - }); -}