mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
chore(mobile): add login integration tests and reorganize CI definitions (#1417)
* Add integration tests for the login process * Reorganize tests * Test wrong instance URL * Run mobile unit tests in CI * Fix CI * Pin Flutter Version to 3.3.10 * Push something stupid to re-trigger CI
This commit is contained in:
parent
d1db47ee34
commit
f64db3a2f9
8 changed files with 212 additions and 76 deletions
|
|
@ -1,14 +1,28 @@
|
|||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:immich_mobile/main.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:immich_mobile/main.dart' as app;
|
||||
|
||||
import 'login_helper.dart';
|
||||
|
||||
class ImmichTestHelper {
|
||||
|
||||
final WidgetTester tester;
|
||||
|
||||
ImmichTestHelper(this.tester);
|
||||
|
||||
ImmichTestLoginHelper? _loginHelper;
|
||||
|
||||
ImmichTestLoginHelper get loginHelper {
|
||||
_loginHelper ??= ImmichTestLoginHelper(tester);
|
||||
return _loginHelper!;
|
||||
}
|
||||
|
||||
static Future<IntegrationTestWidgetsFlutterBinding> initialize() async {
|
||||
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
|
||||
|
|
@ -32,9 +46,12 @@ class ImmichTestHelper {
|
|||
|
||||
}
|
||||
|
||||
void immichWidgetTest(String description, Future<void> Function(WidgetTester) test) {
|
||||
testWidgets(description, (widgetTester) async {
|
||||
await ImmichTestHelper.loadApp(widgetTester);
|
||||
await test(widgetTester);
|
||||
});
|
||||
@isTest
|
||||
void immichWidgetTest(String description, Future<void> Function(WidgetTester, ImmichTestHelper) test) {
|
||||
|
||||
testWidgets(description, (widgetTester) async {
|
||||
await ImmichTestHelper.loadApp(widgetTester);
|
||||
await test(widgetTester, ImmichTestHelper(widgetTester));
|
||||
}, semanticsEnabled: false);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue