App launch parameters
Overview
Launch parameters allow your app to execute specified actions upon launch, guided by the data received. They are crucial in testing scenarios to simulate different user journeys and validate that the app behaves as expected. In the context of automated E2E testing with our services, you can efficiently retrieve and utilize these parameters to streamline your testing workflows.
For convenience, we set the key "isGptDriver": true while running your app on our platform to allow you to easily detect if your app is running in GPT Driver.
Retrieve data
Swift: Retrieving Data with UserDefaults
The data passed will be stored in the shared defaults object, accessible by calling the appropriate method (based on type) e.g.
Swift
Kotlin/Java: With Intents
The data will be passed as extras into the intent that launches your app, accessible by calling the appropriate get method (based on type) e.g.
Kotlin
Kotlin/Java: With Shared Preferences
The data will also be stored in SharedPreferences under a file called prefs.db
. This is accessible by fetching that SharedPreferences
instance and calling the appropriate get method e.g.
Kotlin
Pass data
To initiate tests and pass launch parameters to your app, you can send a JSON payload to our executeTests endpoints.
API Call Payload
Your JSON payload should have the following structure:
JSON
Here, launchParams
is a JSON object that contains key-value pairs you wish to pass as launch parameters. You can add any number of keys and values to the launchParams
object based on your requirements.
Example
Let's say you want to pass a launch parameter version
with value 1.2.0
and featureFlag
with value true
. Your JSON payload would look something like:
JSON
With this setup, the defined launch parameters will be passed to your app when running tests, allowing you to simulate various conditions and configurations during your automated end-to-end tests.
Last updated