From b4c801188110a4aa0ccc65e56f6a88f23703e0b9 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:27:04 +0800 Subject: [PATCH] ci: fix flaky flutter integration tests (#4870) --- .../desktop/database/database_calendar_test.dart | 2 +- .../desktop/database/database_field_test.dart | 7 +++++-- .../integration_test/shared/common_operations.dart | 4 +--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/appflowy_flutter/integration_test/desktop/database/database_calendar_test.dart b/frontend/appflowy_flutter/integration_test/desktop/database/database_calendar_test.dart index adfb670fe2..d5916c627b 100644 --- a/frontend/appflowy_flutter/integration_test/desktop/database/database_calendar_test.dart +++ b/frontend/appflowy_flutter/integration_test/desktop/database/database_calendar_test.dart @@ -82,7 +82,7 @@ void main() { // Hover over today's calendar cell await tester.hoverOnTodayCalendarCell( // Tap on create new event button - onHover: () async => tester.tapAddCalendarEventButton(), + onHover: tester.tapAddCalendarEventButton, ); // Make sure that the event editor popup is shown diff --git a/frontend/appflowy_flutter/integration_test/desktop/database/database_field_test.dart b/frontend/appflowy_flutter/integration_test/desktop/database/database_field_test.dart index 22838adddd..30f79e1ac8 100644 --- a/frontend/appflowy_flutter/integration_test/desktop/database/database_field_test.dart +++ b/frontend/appflowy_flutter/integration_test/desktop/database/database_field_test.dart @@ -346,11 +346,14 @@ void main() { await tester.tapNewPropertyButton(); await tester.renameField(FieldType.LastEditedTime.i18n); await tester.tapSwitchFieldTypeButton(); + + // get time just before modifying + final modified = DateTime.now(); + + // create a last modified field (cont'd) await tester.selectFieldType(FieldType.LastEditedTime); await tester.dismissFieldEditor(); - final modified = DateTime.now(); - tester.assertCellContent( rowIndex: 0, fieldType: FieldType.CreatedTime, diff --git a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart b/frontend/appflowy_flutter/integration_test/shared/common_operations.dart index ab9cbdc0d0..abfcb324f6 100644 --- a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart +++ b/frontend/appflowy_flutter/integration_test/shared/common_operations.dart @@ -162,9 +162,7 @@ extension CommonOperations on WidgetTester { }) async { try { final gesture = await createGesture(kind: PointerDeviceKind.mouse); - await gesture.addPointer(location: Offset.zero); - await pump(); - await gesture.moveTo(offset ?? getCenter(finder)); + await gesture.addPointer(location: offset ?? getCenter(finder)); await pumpAndSettle(); await onHover?.call(); await gesture.removePointer();