GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Apache License 2.0
2.29k stars 152 forks source link

Force to use webview when testing #813

Closed jeroenslor closed 10 months ago

jeroenslor commented 1 year ago

Is your feature request related to a problem? Please describe. We are running a TWA on an Android device that has no Chrome installed and we used fallbackType: webview to make sure it fallback to using the Android webview. We would like to run automated tests but with most of the platforms (like sauce labs or browser stack) you are not allowed to uninstall apps (like Chrome) before running tests. This is required for us because want to make sure we can test the app when using the webview. Currently, we have no option to build the apk which is forced to use the webview instead of Chrome (even if Chrome is installed).

Describe the solution you'd like A CLI option that allows us to force the use of webview

Describe alternatives you've considered

andreban commented 1 year ago

Are you able to run adb commands on the device before running tests?

jeroenslor commented 1 year ago

No very limited what you can do on the platforms. My current workaround is to make sure I have the same webview version installed as Chrome. Technically it's not 100% accurate since in prod there is no Chrome installed so it will be using webview and during the test, it will use Chrome, but at least the Chromium version is the same.

andreban commented 11 months ago

Technically it's not 100% accurate since in prod there is no Chrome installed so it will be using webview

Does it mean in production it will always use WebView?

jeroenslor commented 11 months ago

Technically it's not 100% accurate since in prod there is no Chrome installed so it will be using webview

Does it mean in production it will always use WebView?

Yes

andreban commented 11 months ago

Got it - I'd be interested in learning more about the use-case. I'd be happy to discuss via DM or video call, if that helps. My initial thought is that it'd be more practice to build an Android App that launches something like the WebView Fallback Activity, but suspect there may be other blockers I'm not aware of.

jeroenslor commented 10 months ago

Yeah I agree, the team does not want to maintain the android app required for wrapping so maybe something like capacitor might be a better match since that also relies on webview?