mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +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.
|
||||
await tester.tap(find.byKey(ValueKey('remove_icon_5')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||
|
||||
// Verify if it disappears.
|
||||
expect(find.text('Item 5'), findsNothing);
|
||||
|
||||
@@ -4,20 +4,4 @@
|
||||
|
||||
import 'package:integration_test/integration_test_driver.dart';
|
||||
|
||||
Future<void> main() {
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
Future<void> main() => integrationDriver();
|
||||
|
||||
@@ -23,9 +23,6 @@ void main() {
|
||||
final listFinder = find.byType(ListView);
|
||||
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
|
||||
// the list of items.
|
||||
await binding.watchPerformance(
|
||||
@@ -49,20 +46,11 @@ void main() {
|
||||
// Send the performance summary to the driver.
|
||||
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 {
|
||||
await tester.pumpWidget(TestingApp());
|
||||
|
||||
// Record the performance timeline of the following operations.
|
||||
await binding.traceAction(
|
||||
() async {
|
||||
// Record the performance summary as operations are performed
|
||||
// on the favorites list.
|
||||
await binding.watchPerformance(
|
||||
@@ -78,7 +66,7 @@ void main() {
|
||||
for (var icon in iconKeys) {
|
||||
// Tap onto the icon.
|
||||
await tester.tap(find.byKey(ValueKey(icon)));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||
|
||||
// Verify if appropriate message appears.
|
||||
expect(find.text('Added to favorites.'), findsOneWidget);
|
||||
@@ -99,7 +87,7 @@ void main() {
|
||||
for (final iconKey in removeIconKeys) {
|
||||
// Tap onto the remove icon.
|
||||
await tester.tap(find.byKey(ValueKey(iconKey)));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.pumpAndSettle(Duration(seconds: 1));
|
||||
|
||||
// Verify if appropriate message appears.
|
||||
expect(find.text('Removed from favorites.'), findsOneWidget);
|
||||
@@ -108,12 +96,6 @@ void main() {
|
||||
// Send the performance summary to the driver.
|
||||
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
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.3"
|
||||
version: "2.5.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.5"
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -70,14 +70,14 @@ packages:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.5"
|
||||
version: "1.15.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -112,14 +112,14 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.0-nullsafety.4"
|
||||
version: "6.0.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -195,14 +195,14 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.3"
|
||||
version: "0.12.10"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.6"
|
||||
version: "1.3.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -251,7 +251,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.3"
|
||||
version: "1.8.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -265,21 +265,21 @@ packages:
|
||||
name: platform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0-nullsafety.4"
|
||||
version: "3.0.0"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0-nullsafety.3"
|
||||
version: "1.5.0"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: process
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0-nullsafety.4"
|
||||
version: "4.0.0"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -333,42 +333,42 @@ packages:
|
||||
name: source_map_stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.4"
|
||||
version: "2.1.0"
|
||||
source_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_maps
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.10-nullsafety.3"
|
||||
version: "0.10.10"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.4"
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.6"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0"
|
||||
sync_http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -382,42 +382,42 @@ packages:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.3"
|
||||
version: "1.2.0"
|
||||
test:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.16.0-nullsafety.17"
|
||||
version: "1.16.0-nullsafety.19"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.6"
|
||||
version: "0.2.19"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.12-nullsafety.15"
|
||||
version: "0.3.12-nullsafety.17"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.5"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.5"
|
||||
version: "2.1.0"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user