Upload Flutter test suites to BrowserStack
After you have uploaded your Android app to App Automate, upload your Flutter integration test suite.
The mechanics of uploading a test suite is similar to uploading an app. As with an app, you can upload a Flutter integration test suite (.apk file
) from your filesystem or from a public URL using the Upload test suite REST API. To automate the upload process, configure it as part of your CI/CD pipeline.
With each test suite upload, the system generates a new value for test_suite_url
. You can use this value to execute your Flutter integration tests using the latest build of your test suite.
Command to upload a test suite
Here’s a cURL
command that uses sample values to upload a test suite to BrowserStack:
API response
When you run the sample cURL
command, the BrowserStack server returns the following response:
{
"test_suite_name": "SampleTestSuite.apk",
"test_suite_url": "bs://8864396edcdf1108044d9f876502b3a51db5a26c",
"test_suite_id": "8864396edcdf1108044d9f876502b3a51db5a26c",
"uploaded_at": "2023-07-20 11:07:51 UTC",
"expiry": "2023-08-19 11:07:51 UTC",
"framework": "flutter"
}
Note the test_suite_url
key in the response. Its value is the unique url that BrowserStack creates for the test suite. In the command to run your test, use this value to denote the test suite you want to execute.
Also note the expiry
date. It indicates that the test suite you uploaded is deleted from the server after 30 days.
Specify a custom ID for the test suite
Recall that BrowserStack creates a unique url for each subsequent upload of your test suite. To run your latest tests on your app, use the newly generated test suite URL. If you’ve automated your test execution process, it’s impractical to change your automation API calls to modify the URL every time you upload a different version of the test suite.
To avoid that:
- Define a
custom ID
for your test suite the first time you upload it. - In your automation API calls in which you have the command to run your test, reference your test suite using the
custom ID
. - For all subsequent uploads of the test suite, use the same ID.
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(-).
Here is a sample cURL
command to set custom_id
:
Note the custom_id
parameter and its value, SampleTestSuite
, in the command. This is how you define a custom ID
when uploading a test suite.
Here is a sample response with the custom_id
:
{
"test_suite_name": "SampleTestSuite.apk",
"test_suite_url": "bs://8864396edcdf1108044d9f876502b3a51db5a26c",
"test_suite_id": "8864396edcdf1108044d9f876502b3a51db5a26c",
"uploaded_at": "2023-07-20 11:07:51 UTC",
"expiry": "2023-08-19 11:07:51 UTC",
"custom_id": "SampleTestSuite",
"framework": "flutter",
"shareable_id": "userid/SampleTestSuite"
}
Share your test suite
Other users in your team can execute Flutter integration tests with a test suite uploaded by you. They need to use the shareable_id
value to specify the test suite under test while executing their Flutter integration tests.
Depending on size, it takes a few seconds to about a minute to upload a test suite. Don’t interrupt the cURL
command execution. Wait until you get a response.
Related topics
-
Manage your uploaded test suite using our REST API.
-
Use the recent test suite API endpoint to list your recently uploaded test suites.
-
Delete your uploaded test suite using the delete test suite 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!