admin管理员组文章数量:1336660
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:
- Enabled Developer mode on my Chromebook.
- Updated the chrome_dev.conf file on the Chromebook to enable --remote-debugging-port.
- Started an SSH tunnel on the Chromebook from the VT-2 terminal and connected to it from my Mac.
With these steps, I can successfully remote debug my application from my Mac, and Puppeteer tests can connect to it. However:
- The tests fail to locate elements when the PWA runs in Kiosk mode.
- When the test completes, the session on the Chromebook restarts, which kills the SSH tunnel.
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:
- The tests pass and can locate elements.
- The session doesn’t restart, allowing for reruns of the tests.
Some questions that I have:
- Is it possible to remotely debug a PWA running on a Chromebook from two separate machines without relying on an SSH tunnel?
- Is there any framework (e.g., Puppeteer, Selenium, or others) that can successfully interact with a PWA in Kiosk mode?
- Would it be possible to "simulate" Kiosk mode while not actually being in Kiosk mode?
Any guidance, frameworks, or alternative approaches would be greatly appreciated!
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:
- Enabled Developer mode on my Chromebook.
- Updated the chrome_dev.conf file on the Chromebook to enable --remote-debugging-port.
- Started an SSH tunnel on the Chromebook from the VT-2 terminal and connected to it from my Mac.
With these steps, I can successfully remote debug my application from my Mac, and Puppeteer tests can connect to it. However:
- The tests fail to locate elements when the PWA runs in Kiosk mode.
- When the test completes, the session on the Chromebook restarts, which kills the SSH tunnel.
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:
- The tests pass and can locate elements.
- The session doesn’t restart, allowing for reruns of the tests.
Some questions that I have:
- Is it possible to remotely debug a PWA running on a Chromebook from two separate machines without relying on an SSH tunnel?
- Is there any framework (e.g., Puppeteer, Selenium, or others) that can successfully interact with a PWA in Kiosk mode?
- Would it be possible to "simulate" Kiosk mode while not actually being in Kiosk mode?
Any guidance, frameworks, or alternative approaches would be greatly appreciated!
Share Improve this question edited Nov 19, 2024 at 16:26 Kelly Seeman asked Nov 19, 2024 at 15:32 Kelly SeemanKelly Seeman 11 bronze badge1 Answer
Reset to default 0I 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:
https://chromium.googlesource/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/chromeos-sshd-init/files/openssh-server.conf.README#25
Run a helper program.
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.
Remove rootfs verification.
$ /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification
$ reboot
Install sshd startup files.
$ /usr/libexec/debugd/helpers/dev_features_ssh
Allow password access (optional).
$ 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.
本文标签: puppeteerHow can I run test automation on a PWA in Kiosk mode on a ChromebookStack Overflow
版权声明:本文标题:puppeteer - How can I run test automation on a PWA in Kiosk mode on a Chromebook? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742418020a2471094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论