From 4c67ba82d7d70813ad8cd58d698add7ac3baf34d Mon Sep 17 00:00:00 2001 From: pdenert Date: Wed, 30 Oct 2024 15:30:41 +0100 Subject: [PATCH] Create proper report path on android app with flavor --- .../patrol_cli/lib/src/android/android_test_backend.dart | 7 ++++++- packages/patrol_cli/lib/src/commands/develop.dart | 1 + packages/patrol_cli/lib/src/commands/test.dart | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/patrol_cli/lib/src/android/android_test_backend.dart b/packages/patrol_cli/lib/src/android/android_test_backend.dart index 93c3fe4ab..18e132efe 100644 --- a/packages/patrol_cli/lib/src/android/android_test_backend.dart +++ b/packages/patrol_cli/lib/src/android/android_test_backend.dart @@ -188,6 +188,7 @@ class AndroidTestBackend { Future execute( AndroidAppOptions options, Device device, { + String? flavor, bool interruptible = false, required bool showFlutterLogs, required bool showTestSteps, @@ -207,8 +208,12 @@ class AndroidTestBackend { ) ..disposedBy(scope); + var flavorPath = ''; + if (flavor != null) { + flavorPath = 'flavors/$flavor/'; + } final reportPath = - 'file://${_fs.currentDirectory.path}/build/app/reports/androidTests/connected/index.html'; + 'file://${_fs.currentDirectory.path}/build/app/reports/androidTests/connected/${flavorPath}index.html'; final patrolLogReader = PatrolLogReader( listenStdOut: processLogcat.listenStdOut, diff --git a/packages/patrol_cli/lib/src/commands/develop.dart b/packages/patrol_cli/lib/src/commands/develop.dart index 47970d4dc..b2fea350b 100644 --- a/packages/patrol_cli/lib/src/commands/develop.dart +++ b/packages/patrol_cli/lib/src/commands/develop.dart @@ -339,6 +339,7 @@ class DevelopCommand extends PatrolCommand { interruptible: true, showFlutterLogs: showFlutterLogs, showTestSteps: showTestSteps, + flavor: flutterOpts.flavor, ); final package = android.packageName; if (package != null && uninstall) { diff --git a/packages/patrol_cli/lib/src/commands/test.dart b/packages/patrol_cli/lib/src/commands/test.dart index 497bc490b..cd7209a9a 100644 --- a/packages/patrol_cli/lib/src/commands/test.dart +++ b/packages/patrol_cli/lib/src/commands/test.dart @@ -356,6 +356,7 @@ See https://github.com/leancodepl/patrol/issues/1316 to learn more. device, showFlutterLogs: showFlutterLogs, showTestSteps: showTestSteps, + flavor: flutterOpts.flavor, ); final package = android.packageName; if (package != null && uninstall) {