Skip to content

Commit

Permalink
make custom_id configurable when calling from comamnd line
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianBissekkou committed Jan 16, 2024
1 parent e4fdc3c commit 35ab61f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption {
List<String> 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);

Expand All @@ -47,6 +54,7 @@ class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption {
browserstackAccessKey:
argResults[IntegrationTestParameter.browserstackAccessKeyParam]
as String,
customId: argResults[IntegrationTestParameter.customIdParam],
);
}

Expand Down
17 changes: 14 additions & 3 deletions lib/src/integration_test/option/integration_test_ios_option.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ class IntegrationTestIosOption with _$IntegrationTestIosOption {
List<String> 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);

Expand All @@ -40,6 +50,7 @@ class IntegrationTestIosOption with _$IntegrationTestIosOption {
argResults[IntegrationTestParameter.browserstackAccessKeyParam]
as String,
testPackage: await fileFromRelativePath(testPackagePath),
customId: argResults[IntegrationTestParameter.customIdParam],
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class IntegrationTestParameter {
static const String browserstackAccessKeyParam = "accessKey";
static const String browserstackUserParam = "user";
static const String customIdParam = "customId";

// region android

Expand Down
4 changes: 4 additions & 0 deletions lib/src/integration_test/run_ios_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> arguments) {
runIosIntegrationTest(arguments);
}

Future<void> runIosIntegrationTest(List<String> arguments) async {
const api = BrowserStackApi();
final option = await IntegrationTestIosOption.fromArguments(arguments);
Expand Down

0 comments on commit 35ab61f

Please sign in to comment.