Skip to content

Commit

Permalink
add custom_id to upload request
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianBissekkou committed Jan 18, 2024
1 parent 35ab61f commit 50fb102
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/src/integration_test/browser_stack_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class BrowserStackApi {
required String url,
required File file,
required String basicAuthHeader,
Map<String, String> fields = const <String, String>{},
}) async {
final filename = file.path.split("/").last;

Expand Down Expand Up @@ -39,7 +40,8 @@ class BrowserStackApi {
},
)
..headers[HttpHeaders.authorizationHeader] = basicAuthHeader
..files.add(await http.MultipartFile.fromPath("file", file.path));
..files.add(await http.MultipartFile.fromPath("file", file.path))
..fields.addAll(fields);

final response = await http.Response.fromStream(await request.send());

Expand Down
4 changes: 3 additions & 1 deletion lib/src/integration_test/run_android_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Future<void> runAndroidIntegrationTest(List<String> arguments) async {
file: option.testSuite,
url:
"https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/test-suite",
fields: {
if (option.customId != null) "custom_id": option.customId!,
},
);

final testSuiteUrl = uploadTestSuiteResponse.getRequiredKey("test_suite_url");
Expand All @@ -35,7 +38,6 @@ Future<void> runAndroidIntegrationTest(List<String> arguments) async {
"devices": option.devices,
"networkLogs": option.networkLogs,
"deviceLogs": option.deviceLogs,
if (option.customId != null) "custom_id": option.customId!,
},
);

Expand Down
4 changes: 3 additions & 1 deletion lib/src/integration_test/run_ios_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Future<void> runIosIntegrationTest(List<String> arguments) async {
"https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/ios/test-package",
file: option.testPackage,
basicAuthHeader: option.basicAuthValue,
fields: {
if (option.customId != null) "custom_id": option.customId!,
},
);

final testPackageUrl = uploadPackageResult.getRequiredKey("test_package_url");
Expand All @@ -29,7 +32,6 @@ Future<void> runIosIntegrationTest(List<String> arguments) async {
"networkLogs": option.networkLogs,
"deviceLogs": option.deviceLogs,
"devices": option.devices,
if (option.customId != null) "custom_id": option.customId!,
},
);

Expand Down

0 comments on commit 50fb102

Please sign in to comment.