mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Revert integration_test in flutter create template (#74068)
* Revert "Add integration_test template to create template (#70240)"
This reverts commit d047d108eb
.
* test
This commit is contained in:
parent
6a4808b4ed
commit
6a32859eb9
|
@ -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}}
|
||||
});
|
||||
}
|
|
@ -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<void> main() => integrationDriver();
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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: <Type, Generator>{
|
||||
|
@ -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);
|
||||
|
|
|
@ -258,10 +258,8 @@ void main() {
|
|||
final PackagesCommand command = await runCommandIn(exampleProjectPath, 'get');
|
||||
final PackagesGetCommand getCommand = command.subcommands['get'] as PackagesGetCommand;
|
||||
|
||||
// Should be 1 instead of 2, but integration_test is always included.
|
||||
// https://github.com/flutter/flutter/issues/56591
|
||||
expect(await getCommand.usageValues,
|
||||
containsPair(CustomDimensions.commandPackagesNumberPlugins, '2'));
|
||||
containsPair(CustomDimensions.commandPackagesNumberPlugins, '1'));
|
||||
}, overrides: <Type, Generator>{
|
||||
Pub: () => Pub(
|
||||
fileSystem: globals.fs,
|
||||
|
|
|
@ -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(
|
||||
<String>[
|
||||
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(
|
||||
<String>[
|
||||
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.');
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue