Add shell to PatrolIntegrationTester
, or ability to execute code on testing machine
#2386
Labels
feature
New feature request
package: patrol
Related to the patrol package (native automation, test bundling)
Use case
I am writing patrol test to test my Flutter app on Android emulator on my machine. I want to be able to run terminal commands on my host machine during the patrol test (inside the
PatrolTesterCallback
).This feature request is indeed related to the problem I am having, however the feature will serve a much wider variety of cases than described shortly.
So, the problem is that I cannot trigger Android's flow for handling URLs of Instant Apps. When testing manually, I usually fire this terminal command:
adb shell 'am start -a android.intent.action.VIEW -d "https://..." com.my.applicationId'
this brings up this system UI:
And then, when testing manually, I click "OPEN APP", which opens Android Instant App, from which I download my full app and get to testing further.
The
adb
command above is not the only one I wish to be able to run from within the patrol test. I also want to generate the URL during the test, and for this I have a nifty CLI command on my machine (it contacts my server to get me the URL).To sum up, I want to start my patrol test by running a few terminal commands (executing them on my host machine), and then start using patrol's finders to assert what is shown on the emulator's screen.
What I have tried:
There is already a native
openUrl
method provided by patrol. However, it never opens the Android's UI as in the picture above - it simply opens the browser (not even my app, which actually handles the URL nicely).openUrl
will only open my app, if the URL schema is a custom schema that my app supports. I mean, my app support both "https://" and "mycustomapp" shemas. But with patrol I am not able to test "https" schema, as it always opens the browser. This, obviously, makes it impossible to test the real user flow - user clicking on the URL, user making a decision to continue viewing the URL in the Instant App, user interacting with Instant App, user downloading the full app, and user interacting with the full app.Proposal
The text was updated successfully, but these errors were encountered: