Skip to content

Commit 4c67ba8

Browse files
committed
Create proper report path on android app with flavor
1 parent 712f76d commit 4c67ba8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/patrol_cli/lib/src/android/android_test_backend.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class AndroidTestBackend {
188188
Future<void> execute(
189189
AndroidAppOptions options,
190190
Device device, {
191+
String? flavor,
191192
bool interruptible = false,
192193
required bool showFlutterLogs,
193194
required bool showTestSteps,
@@ -207,8 +208,12 @@ class AndroidTestBackend {
207208
)
208209
..disposedBy(scope);
209210

211+
var flavorPath = '';
212+
if (flavor != null) {
213+
flavorPath = 'flavors/$flavor/';
214+
}
210215
final reportPath =
211-
'file://${_fs.currentDirectory.path}/build/app/reports/androidTests/connected/index.html';
216+
'file://${_fs.currentDirectory.path}/build/app/reports/androidTests/connected/${flavorPath}index.html';
212217

213218
final patrolLogReader = PatrolLogReader(
214219
listenStdOut: processLogcat.listenStdOut,

packages/patrol_cli/lib/src/commands/develop.dart

+1
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ class DevelopCommand extends PatrolCommand {
339339
interruptible: true,
340340
showFlutterLogs: showFlutterLogs,
341341
showTestSteps: showTestSteps,
342+
flavor: flutterOpts.flavor,
342343
);
343344
final package = android.packageName;
344345
if (package != null && uninstall) {

packages/patrol_cli/lib/src/commands/test.dart

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ See https://github.com/leancodepl/patrol/issues/1316 to learn more.
356356
device,
357357
showFlutterLogs: showFlutterLogs,
358358
showTestSteps: showTestSteps,
359+
flavor: flutterOpts.flavor,
359360
);
360361
final package = android.packageName;
361362
if (package != null && uninstall) {

0 commit comments

Comments
 (0)