Upload your test packages to BrowserStack
To run your flutter integration tests on iOS devices, upload your test package in ‘zip’ format to BrowserStack servers. Refer to this section to learn how to prepare the test package. To upload it, use the upload test package REST API.
When you upload a test package, BrowserStack generates a unique URL (test_package_url
) for it. Use this URL in your test API call. This is how BrowserStack knows which test package to run your test on.
Command to upload a test package
Here’s a cURL
command that uses sample values to upload a test package to BrowserStack:
Depending on size, it takes a few seconds to about a minute to upload a test package. Don’t interrupt the cURL
command execution. Wait until you get a response.
API response
When you run the sample cURL
command, the BrowserStack server returns the following response:
{
"test_package_name": "flutter_ios_public.zip",
"test_package_url": "bs://ab001d58695f23f0ee925ad7e3126015e5846ca8",
"test_package_id": "ab001d58695f23f0ee925ad7e3126015e5846ca8",
"uploaded_at": "2023-11-03 06:38:33 UTC",
"expiry": "2023-12-03 06:38:33 UTC",
"framework": "flutter integration tests"
}
Note the test_package_url
key in the response. Its value is the unique URL that BrowserStack has created for the test package. Use this value to denote the test package you want to test in your API call.
Also note the expiry
date. It indicates that the test package you uploaded gets deleted from the server after 30 days.
Specify a custom ID for the test package
You can streamline the process of test package upload and avoid API call modifications after each build upload by using a constant value to specify the test package under test. To do this, you can follow the steps below:
Define a custom_id
for your test package the first time you upload it.
The maximum character limit in the custom_id parameter is 100 and the characters allowed are a-z, A-Z, 0-9, period(.), underscore(_), and hyphen(-).
In your API calls, reference your test package using the custom ID.
For all subsequent uploads, use the same ID.
Example cURL
command that sets custom_id
:
During the execution of your Flutter integration tests, you can simply use the custom_id
value (SampleApp
in the above example) to specify the test package under test. The test execution then picks the last uploaded build associated with that custom_id
.
Here is a sample response with the custom_id
:
{
"test_package_name": "flutter_ios_public.zip",
"test_package_url": "bs://ab001d58695f23f0ee925ad7e3126015e5846ca8",
"test_package_id": "ab001d58695f23f0ee925ad7e3126015e5846ca8",
"uploaded_at": "2023-11-03 06:38:33 UTC",
"expiry": "2023-12-03 06:38:33 UTC",
"framework": "flutter integration tests",
"custom_id": "SampleApp",
"shareable_id": "sample_user/SampleApp"
}
Share your test package
Other users in your team can execute Flutter integration tests with a test package uploaded by you. They need to use the shareable_id
value to specify the test package under test while executing their Flutter integration tests.
A sample response with the shareable_id
is shown in the section above.
Related topics
-
Manage your uploaded test package using our REST API.
-
Use the list test package API endpoint to list your recently uploaded test package.
-
Delete your uploaded test package using the delete test package API endpoint.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!