mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
test(app): fix integration test and improve reliability and speed (#1792)
This commit is contained in:
parent
5ad4e5b614
commit
78a5fe2d37
3 changed files with 77 additions and 54 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
|
|
@ -43,7 +45,6 @@ class ImmichTestHelper {
|
|||
// Load main Widget
|
||||
await tester.pumpWidget(app.getMainWidget(db));
|
||||
// Post run tasks
|
||||
await tester.pumpAndSettle();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
}
|
||||
}
|
||||
|
|
@ -62,3 +63,17 @@ void immichWidgetTest(
|
|||
semanticsEnabled: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> pumpUntilFound(
|
||||
WidgetTester tester,
|
||||
Finder finder, {
|
||||
Duration timeout = const Duration(seconds: 120),
|
||||
}) async {
|
||||
bool found = false;
|
||||
final timer = Timer(timeout, () => throw TimeoutException("Pump until has timed out"));
|
||||
while (found != true) {
|
||||
await tester.pump();
|
||||
found = tester.any(finder);
|
||||
}
|
||||
timer.cancel();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue