From 1ca49e7db3b94f0d88b106184f4fb109c3ad6b7f Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Thu, 26 Sep 2024 16:51:42 +0200 Subject: [PATCH] test: integration test cleanup --- .../app/integration_test/app_local_data_test.dart | 9 +++++---- .../app/integration_test/app_server_data_test.dart | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/compass_app/app/integration_test/app_local_data_test.dart b/compass_app/app/integration_test/app_local_data_test.dart index e631046d6..773fcde26 100644 --- a/compass_app/app/integration_test/app_local_data_test.dart +++ b/compass_app/app/integration_test/app_local_data_test.dart @@ -88,7 +88,8 @@ void main() { // Select first and last widget that matches today number //and tomorrow number, sort of ensures a valid range await tester.tap(find.text(tomorrow.toString()).first); - await tester.tap(find.text(nextDay.toString()).last); + await tester.pumpAndSettle(); + await tester.tap(find.text(nextDay.toString()).first); await tester.pumpAndSettle(); await tester.tap(find.text('Save')); await tester.pumpAndSettle(); @@ -102,7 +103,7 @@ void main() { // Perform search and navigate to next screen await tester.tap(find.byKey(const ValueKey('submit_button'))); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Results Screen expect(find.byType(ResultsScreen), findsOneWidget); @@ -110,7 +111,7 @@ void main() { // Amalfi Coast should be the first result for Europe // Tap and navigate to activities screen await tester.tap(find.byType(ResultCard).first); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Activities Screen expect(find.byType(ActivitiesScreen), findsOneWidget); @@ -122,7 +123,7 @@ void main() { // Submit selection await tester.tap(find.byKey(const ValueKey('confirm-button'))); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Should be at booking screen expect(find.byType(BookingScreen), findsOneWidget); diff --git a/compass_app/app/integration_test/app_server_data_test.dart b/compass_app/app/integration_test/app_server_data_test.dart index 88df0f8e9..d23d52874 100644 --- a/compass_app/app/integration_test/app_server_data_test.dart +++ b/compass_app/app/integration_test/app_server_data_test.dart @@ -148,7 +148,8 @@ void main() { // Select first and last widget that matches today number //and tomorrow number, sort of ensures a valid range await tester.tap(find.text(tomorrow.toString()).first); - await tester.tap(find.text(nextDay.toString()).last); + await tester.pumpAndSettle(); + await tester.tap(find.text(nextDay.toString()).first); await tester.pumpAndSettle(); await tester.tap(find.text('Save')); await tester.pumpAndSettle(); @@ -162,7 +163,7 @@ void main() { // Perform search and navigate to next screen await tester.tap(find.byKey(const ValueKey('submit_button'))); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Results Screen expect(find.byType(ResultsScreen), findsOneWidget); @@ -170,7 +171,7 @@ void main() { // Amalfi Coast should be the first result for Europe // Tap and navigate to activities screen await tester.tap(find.byType(ResultCard).first); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Activities Screen expect(find.byType(ActivitiesScreen), findsOneWidget); @@ -182,7 +183,7 @@ void main() { // Submit selection await tester.tap(find.byKey(const ValueKey('confirm-button'))); - await tester.pumpAndSettle(const Duration(seconds: 2)); + await tester.pumpAndSettle(); // Should be at booking screen expect(find.byType(BookingScreen), findsOneWidget);