Skip to content

Commit

Permalink
POC Flutter Drive test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdat committed Jun 28, 2024
1 parent 98c848d commit 1ef25cd
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 3 deletions.
28 changes: 28 additions & 0 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (server_settings)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (model)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (rule_filter)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (contact)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (core)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (email_recovery)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (fcm)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (forward)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import

Check notice on line 2 in integration_test/app_test.dart

View workflow job for this annotation

GitHub Actions / analyze-test (default)

The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. For more details, see https://dart.dev/tools/diagnostic-messages#unnecessary_import
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:tmail_ui_user/main.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

FlutterExceptionHandler? originalOnError;

setUp(() {
// Save the original error handler
originalOnError = FlutterError.onError;
});

tearDown(() {
// Reset FlutterError.onError to the original handler
FlutterError.onError = originalOnError;
});

group('[login]', () {
testWidgets('login with OIDC', (WidgetTester tester) async {
await app.main();
await tester.pumpAndSettle();
});
});
}
3 changes: 3 additions & 0 deletions integration_test/integration_test_driver.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:integration_test/integration_test_driver.dart';

Future<void> main() => integrationDriver();
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
import 'package:url_strategy/url_strategy.dart';
import 'package:worker_manager/worker_manager.dart';

void main() async {
Future<void> main() async {
initLogger(() async {
WidgetsFlutterBinding.ensureInitialized();
ThemeUtils.setSystemLightUIStyle();
Expand Down
43 changes: 41 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.10.2"
flutter_driver:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_image_compress:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1006,6 +1011,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.0"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
future_loading_dialog:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1119,6 +1129,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
integration_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
internet_connection_checker:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1460,10 +1475,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
url: "https://pub.dev"
source: hosted
version: "3.1.3"
version: "3.1.2"
plugin_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -1750,6 +1765,14 @@ packages:
url: "https://github.com/dab246/super_tag_editor.git"
source: git
version: "0.2.0"
sync_http:
dependency: transitive
description:
name: sync_http
sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
syncfusion_flutter_core:
dependency: transitive
description:
Expand Down Expand Up @@ -1966,6 +1989,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.3"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
url: "https://pub.dev"
source: hosted
version: "11.10.0"
watcher:
dependency: transitive
description:
Expand All @@ -1990,6 +2021,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.4.0"
webdriver:
dependency: transitive
description:
name: webdriver
sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
win32:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
integration_test:
sdk: flutter

build_runner: 2.3.3

Expand Down

0 comments on commit 1ef25cd

Please sign in to comment.