Add OPNsense WebGUI regression tests

This commit is contained in:
ms2k 2026-08-07 00:29:07 +09:00
commit 1ef0b80415

24
tests/ui/README.md Normal file
View file

@ -0,0 +1,24 @@
# OPNsense WebGUI integration tests
These Playwright tests use a disposable OPNsense deployment. They create and delete NordVPN enrollment records and require `OPNSENSE_UI_TEST_ALLOW_MUTATION=1`.
Start a QEMU fixture after building a package. The launcher needs a compatible OPNsense base image and transfer disk, neither of which is stored in this repository.
```sh
NORDVPN_PACKAGE_PATH=/path/to/os-nordvpn.pkg \
OPNSENSE_VM_IMAGE=/path/to/opnsense.qcow2 \
OPNSENSE_TRANSFER_IMAGE=/path/to/transfer.img \
tests/ui/start-opnsense.sh
```
In another terminal, run the browser suite against the disposable WebGUI:
```sh
OPNSENSE_UI_BASE_URL=https://127.0.0.1:18443 \
OPNSENSE_UI_USERNAME=root \
OPNSENSE_UI_PASSWORD=... \
OPNSENSE_UI_TEST_ALLOW_MUTATION=1 \
sh -c 'cd tests/ui && pnpm install --frozen-lockfile && pnpm test'
```
The suite mocks only the countries API response with synthetic values. It covers populated country options, failure-policy labels, native alias selectors, Add/Edit/Clone state restoration, and the selector menu/footer layout.