From 35ab61f04d6ea58f11ec9ff9e875cd283951ace5 Mon Sep 17 00:00:00 2001 From: Julian Bissekkou Date: Tue, 16 Jan 2024 16:23:12 +0100 Subject: [PATCH] make custom_id configurable when calling from comamnd line --- .../option/integration_test_android_option.dart | 16 ++++++++++++---- .../option/integration_test_ios_option.dart | 17 ++++++++++++++--- .../option/integration_test_parameter.dart | 1 + .../run_ios_integration_test.dart | 4 ++++ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/src/integration_test/option/integration_test_android_option.dart b/lib/src/integration_test/option/integration_test_android_option.dart index d53be15..a70abf5 100644 --- a/lib/src/integration_test/option/integration_test_android_option.dart +++ b/lib/src/integration_test/option/integration_test_android_option.dart @@ -27,10 +27,17 @@ class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption { List arguments, ) async { final parser = ArgParser() - ..addOption(IntegrationTestParameter.apkPathParam) - ..addOption(IntegrationTestParameter.testSuitePathParam) - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam); + ..addOption(IntegrationTestParameter.apkPathParam, mandatory: true) + ..addOption(IntegrationTestParameter.testSuitePathParam, mandatory: true) + ..addOption( + IntegrationTestParameter.browserstackUserParam, + mandatory: true, + ) + ..addOption( + IntegrationTestParameter.browserstackAccessKeyParam, + mandatory: true, + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments); @@ -47,6 +54,7 @@ class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption { browserstackAccessKey: argResults[IntegrationTestParameter.browserstackAccessKeyParam] as String, + customId: argResults[IntegrationTestParameter.customIdParam], ); } diff --git a/lib/src/integration_test/option/integration_test_ios_option.dart b/lib/src/integration_test/option/integration_test_ios_option.dart index cf85d70..838843f 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.dart @@ -24,9 +24,19 @@ class IntegrationTestIosOption with _$IntegrationTestIosOption { List arguments, ) async { final parser = ArgParser() - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) - ..addOption(IntegrationTestParameter.testPackagePathParam); + ..addOption( + IntegrationTestParameter.browserstackUserParam, + mandatory: true, + ) + ..addOption( + IntegrationTestParameter.browserstackAccessKeyParam, + mandatory: true, + ) + ..addOption( + IntegrationTestParameter.testPackagePathParam, + mandatory: true, + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments); @@ -40,6 +50,7 @@ class IntegrationTestIosOption with _$IntegrationTestIosOption { argResults[IntegrationTestParameter.browserstackAccessKeyParam] as String, testPackage: await fileFromRelativePath(testPackagePath), + customId: argResults[IntegrationTestParameter.customIdParam], ); } diff --git a/lib/src/integration_test/option/integration_test_parameter.dart b/lib/src/integration_test/option/integration_test_parameter.dart index 6bd6fb4..fd9ae51 100644 --- a/lib/src/integration_test/option/integration_test_parameter.dart +++ b/lib/src/integration_test/option/integration_test_parameter.dart @@ -1,6 +1,7 @@ class IntegrationTestParameter { static const String browserstackAccessKeyParam = "accessKey"; static const String browserstackUserParam = "user"; + static const String customIdParam = "customId"; // region android diff --git a/lib/src/integration_test/run_ios_integration_test.dart b/lib/src/integration_test/run_ios_integration_test.dart index 78ffbaa..9f7c320 100644 --- a/lib/src/integration_test/run_ios_integration_test.dart +++ b/lib/src/integration_test/run_ios_integration_test.dart @@ -3,6 +3,10 @@ import 'package:tapped_test_toolkit/src/integration_test/browser_stack_api.dart' import 'package:tapped_test_toolkit/src/integration_test/browser_stack_test_status.dart'; import 'package:tapped_test_toolkit/src/integration_test/option/integration_test_ios_option.dart'; +void main(List arguments) { + runIosIntegrationTest(arguments); +} + Future runIosIntegrationTest(List arguments) async { const api = BrowserStackApi(); final option = await IntegrationTestIosOption.fromArguments(arguments);