π¦ Can I add Waldo-specific functionality to my app ?
Waldo allows you to add functionalities specifically when your application is launched inside Waldo.
This feature is especially useful when:
- Validating a specific menu.
- Setting your application to a specific state.
- Skipping specific verifications inside your application.
- Preventing specific network requests.
Waldo-specific environment variables
When running inside Waldo, your application is launched with environment variable INSIDE_WALDO
set to the value '1'
.
When your application detects that this environment variable is set, it can trigger or skip specific logic.
Reading the environment variable on iOS
On iOS, you can read the environment variable in Swift like this:
let inWaldo = ProcessInfo.processInfo.environment["INSIDE_WALDO"] == "1"
Reading the environment variable on Android
On Android, you can read the environment variable in Java like this:
boolean inWaldo = "1".equals(System.getProperty("INSIDE_WALDO", "0"));
By determining that your application is running inside Waldo, you can ensure that your tests are deterministic and always replay effectively.
Updated 4 months ago