I’m trying to run test automation from a development machine against a Progressive Web App (PWA) that will be running in Kiosk mode on a Chromebook. The PWA is intended for use in a Kiosk environment, and I need a reliable way to test its functionality remotely.
So far, I’ve attempted to use Puppeteer for this setup, but I’m running into challenges when interacting with the app in Kiosk mode.
Here’s what I’ve done so far:
With these steps, I can successfully remote debug my application from my Mac, and Puppeteer tests can connect to it. However:
I also tested starting the SSH tunnel from within either VT-2 or Crosh after signing into a user on the Chromebook. In this setup:
Some questions that I have:
Any guidance, frameworks, or alternative approaches would be greatly appreciated!
I was able to figure out a solution after discovering the provided dev_features_ssh executable. I followed these steps to get ssh to start on boot:
An executable named dev_features_ssh is available to enable sshd. Rootfs verification must be removed first or the helper program will have no effect. This will cause sshd to start automatically on each boot with test key access. Password access can optionally be enabled after rootfs verification has been removed.
$ /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification
$ reboot
$ /usr/libexec/debugd/helpers/dev_features_ssh
$ passwd
I was then able to successfully ssh into my Chromebook as root. And I updated my Puppeteer test to connect via the webSocketUrl like this
browser = await puppeteer.connect({
browserWSEndpoint: webSocketDebuggerUrl,
});
You can get the websocketDebuggerUrl from http://localhost:9222/json/version when you have the SSH server up and running.
With all this in place puppeteer was able to interact with the PWA even in kiosk mode and the ssh connection stayed active even if the kiosk app was relaunched. I did up date my Organizational Unit in Google Admin to set the kiosk app to "auto launch on start" so that my Chromebook would always be ready for testing.