mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
[testing_app] Fix failing integration tests (#756)
This commit is contained in:
committed by
GitHub
parent
5adf66ba65
commit
59b50ec010
@@ -80,7 +80,7 @@ void main() {
|
|||||||
|
|
||||||
// Tap on the remove icon.
|
// Tap on the remove icon.
|
||||||
await tester.tap(find.byKey(ValueKey('remove_icon_5')));
|
await tester.tap(find.byKey(ValueKey('remove_icon_5')));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||||
|
|
||||||
// Verify if it disappears.
|
// Verify if it disappears.
|
||||||
expect(find.text('Item 5'), findsNothing);
|
expect(find.text('Item 5'), findsNothing);
|
||||||
|
|||||||
@@ -4,20 +4,4 @@
|
|||||||
|
|
||||||
import 'package:integration_test/integration_test_driver.dart';
|
import 'package:integration_test/integration_test_driver.dart';
|
||||||
|
|
||||||
Future<void> main() {
|
Future<void> main() => integrationDriver();
|
||||||
return integrationDriver(
|
|
||||||
responseDataCallback: (data) async {
|
|
||||||
// If the tests reported any data, save it to the disk.
|
|
||||||
if (data != null) {
|
|
||||||
for (var entry in data.entries) {
|
|
||||||
print('Writing ${entry.key} to the disk.');
|
|
||||||
// Default storage destination is the 'build' directory.
|
|
||||||
await writeResponseData(
|
|
||||||
entry.value as Map<String, dynamic>,
|
|
||||||
testOutputFilename: entry.key,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ void main() {
|
|||||||
final listFinder = find.byType(ListView);
|
final listFinder = find.byType(ListView);
|
||||||
final scroller = tester.widget<ListView>(listFinder).controller;
|
final scroller = tester.widget<ListView>(listFinder).controller;
|
||||||
|
|
||||||
// Record the performance timeline of the following operations.
|
|
||||||
await binding.traceAction(
|
|
||||||
() async {
|
|
||||||
// Record the performance summary as the app scrolls through
|
// Record the performance summary as the app scrolls through
|
||||||
// the list of items.
|
// the list of items.
|
||||||
await binding.watchPerformance(
|
await binding.watchPerformance(
|
||||||
@@ -49,20 +46,11 @@ void main() {
|
|||||||
// Send the performance summary to the driver.
|
// Send the performance summary to the driver.
|
||||||
reportKey: 'scrolling_summary',
|
reportKey: 'scrolling_summary',
|
||||||
);
|
);
|
||||||
},
|
|
||||||
// Send the timeline data to the driver.
|
|
||||||
// This timeline can be opened in the Chrome browser's tracing tools
|
|
||||||
// by navigating to chrome://tracing.
|
|
||||||
reportKey: 'scrolling_timeline',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Favorites operations test', (tester) async {
|
testWidgets('Favorites operations test', (tester) async {
|
||||||
await tester.pumpWidget(TestingApp());
|
await tester.pumpWidget(TestingApp());
|
||||||
|
|
||||||
// Record the performance timeline of the following operations.
|
|
||||||
await binding.traceAction(
|
|
||||||
() async {
|
|
||||||
// Record the performance summary as operations are performed
|
// Record the performance summary as operations are performed
|
||||||
// on the favorites list.
|
// on the favorites list.
|
||||||
await binding.watchPerformance(
|
await binding.watchPerformance(
|
||||||
@@ -78,7 +66,7 @@ void main() {
|
|||||||
for (var icon in iconKeys) {
|
for (var icon in iconKeys) {
|
||||||
// Tap onto the icon.
|
// Tap onto the icon.
|
||||||
await tester.tap(find.byKey(ValueKey(icon)));
|
await tester.tap(find.byKey(ValueKey(icon)));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||||
|
|
||||||
// Verify if appropriate message appears.
|
// Verify if appropriate message appears.
|
||||||
expect(find.text('Added to favorites.'), findsOneWidget);
|
expect(find.text('Added to favorites.'), findsOneWidget);
|
||||||
@@ -99,7 +87,7 @@ void main() {
|
|||||||
for (final iconKey in removeIconKeys) {
|
for (final iconKey in removeIconKeys) {
|
||||||
// Tap onto the remove icon.
|
// Tap onto the remove icon.
|
||||||
await tester.tap(find.byKey(ValueKey(iconKey)));
|
await tester.tap(find.byKey(ValueKey(iconKey)));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||||
|
|
||||||
// Verify if appropriate message appears.
|
// Verify if appropriate message appears.
|
||||||
expect(find.text('Removed from favorites.'), findsOneWidget);
|
expect(find.text('Removed from favorites.'), findsOneWidget);
|
||||||
@@ -108,12 +96,6 @@ void main() {
|
|||||||
// Send the performance summary to the driver.
|
// Send the performance summary to the driver.
|
||||||
reportKey: 'favorites_operations_summary',
|
reportKey: 'favorites_operations_summary',
|
||||||
);
|
);
|
||||||
},
|
|
||||||
// Send the timeline data to the driver.
|
|
||||||
// This timeline can be opened in the Chrome browser's tracing tools
|
|
||||||
// by navigating to chrome://tracing.
|
|
||||||
reportKey: 'favorites_operations_timeline',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,28 +35,28 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.0-nullsafety.3"
|
version: "2.5.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0-nullsafety.3"
|
version: "2.1.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0-nullsafety.5"
|
version: "1.1.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0-nullsafety.3"
|
version: "1.2.0"
|
||||||
cli_util:
|
cli_util:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -70,14 +70,14 @@ packages:
|
|||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0-nullsafety.3"
|
version: "1.1.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0-nullsafety.5"
|
version: "1.15.0"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -112,14 +112,14 @@ packages:
|
|||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0-nullsafety.3"
|
version: "1.2.0"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0-nullsafety.4"
|
version: "6.0.0"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -195,14 +195,14 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10-nullsafety.3"
|
version: "0.12.10"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0-nullsafety.6"
|
version: "1.3.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -251,7 +251,7 @@ packages:
|
|||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0-nullsafety.3"
|
version: "1.8.0"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -265,21 +265,21 @@ packages:
|
|||||||
name: platform
|
name: platform
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0-nullsafety.4"
|
version: "3.0.0"
|
||||||
pool:
|
pool:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pool
|
name: pool
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.0-nullsafety.3"
|
version: "1.5.0"
|
||||||
process:
|
process:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: process
|
name: process
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0-nullsafety.4"
|
version: "4.0.0"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -333,42 +333,42 @@ packages:
|
|||||||
name: source_map_stack_trace
|
name: source_map_stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0-nullsafety.4"
|
version: "2.1.0"
|
||||||
source_maps:
|
source_maps:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_maps
|
name: source_maps
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.10-nullsafety.3"
|
version: "0.10.10"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0-nullsafety.4"
|
version: "1.8.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0-nullsafety.6"
|
version: "1.10.0"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0-nullsafety.3"
|
version: "2.1.0"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0-nullsafety.3"
|
version: "1.1.0"
|
||||||
sync_http:
|
sync_http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -382,42 +382,42 @@ packages:
|
|||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0-nullsafety.3"
|
version: "1.2.0"
|
||||||
test:
|
test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: test
|
name: test
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0-nullsafety.17"
|
version: "1.16.0-nullsafety.19"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.19-nullsafety.6"
|
version: "0.2.19"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.12-nullsafety.15"
|
version: "0.3.12-nullsafety.17"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0-nullsafety.5"
|
version: "1.3.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0-nullsafety.5"
|
version: "2.1.0"
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user