Getting started
First, install the latest version of maestro
as this functionality is available from version 1.22.0
and up.
Setup
Step 1 - Setup Maestro SDK
If you haven't already, make sure to setup Maestro SDK in your project first
Maestro SDKStep 2 - Replace base URL
Then, replace your API base url with a base url provided by Maestro SDK:
import dev.mobile.maestro.sdk.MaestroSdk
// use baseUrl as you normally would
val baseUrl = MaestroSdk.mockServer().url("https://api.company.com")
You can then use baseUrl
as you normally would.
The URL passed in should start with https://
and should not have a trailing /, as that is added by Maestro SDK automatically. You can then access your API endpoint by sending requests to ${baseUrl}${path}
- you don't need to add /
in between.
Step 3 - Try it out
Build and run your app and you should start seeing events in the Maestro Mock Server UI!
Initializing mockserver workspace
You can run maestro mockserver init
to generate a sample rule locally that you can keep building on.
Last updated
Was this helpful?