I have an app using Ionic 8/Capacitor 6 and am beginning to run automated testing using maestro as my test tool. I have a situation where I’d like to determine if the app is running using maestro to mock certain behaviors (e.g. barcode reading). Here’s my app info:
Ionic:
Ionic CLI : 7.2.0 (/Users/ken/.nvm/versions/node/v20.15.1/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.2.7
@angular-devkit/build-angular : 18.2.0
@angular-devkit/schematics : 18.2.0
@angular/cli : 18.2.0
@ionic/angular-toolkit : 11.0.1
Capacitor:
Capacitor CLI : 6.1.2
@capacitor/android : 6.1.2
@capacitor/core : 6.1.2
@capacitor/ios : 6.1.2
Looking at the maestro docs, I see that the app can be started with custom launch arguments and I’d like to use that to determine if maestro is being used.
The docs say
Their examples of retrieving launch arguments are geared toward native apps or react native (https://maestro.mobile.dev/api-reference/commands/launchapp#launch-arguments) but I can’t find a way to do this using Capacitor/Ionic.
I know that apps normally don’t have startup arguments but this is specifically for testing and won’t be used otherwise. This app does not have (and doesn’t need) a custom URL scheme so passing parameters that way is not an option. Can anybody point me in the right direction of how to retrieve launch arguments or a plugin that allows me to do this?
Thanks!