| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Comprehensive automated test suite for the ESP32-S3 Access Controller. Covers API endpoints, configuration toggles, bulk user operations, Playwright browser tests, and interactive physical hardware verification.
cd code/controller/tests
npm install
npx playwright install chromiumThese commands do not contact a device:
| Command | Checks |
|---|---|
| npm run test:wiegand-format | Native Wiegand format handling |
| npm run test:boot-audio | Startup sampling, timers and quiet mode |
| npm run test:ui-network | Desktop/mobile navigation, IP badges and simulated reboot recovery |
Set CHROMIUM_PATH=/usr/bin/google-chrome to use installed Chrome. UI screenshots go to artifacts/network-ui/ or $ARTIFACT_DIR.
The commands below contact a controller and may change lock/input settings.
npm test # Full automated suite (API + stress + UI)
npm run test:api # API state & config only
npm run test:quick # Smoke test (state + connectivity)
npm run test:ui # Playwright browser tests only
npm run test:physical # Interactive hardware walkthroughOr with environment variables:
DEVICE_URL=http://192.168.1.131 npm test| Suite | File | Tests | Description |
|---|---|---|---|
| Build Verification | runner.mjs | 5 | Firmware binaries exist |
| API State & Monitoring | suites/api-state.mjs | 19 | GET endpoints: state, logs, wiegand, rf, wifi, caching |
| API Configuration | suites/api-config.mjs | 29 | POST endpoints: lock, exit, fob, keypad toggles + PIN user CRUD + channel isolation |
| Stress & Bulk | suites/stress-bulk.mjs | 39 | 30-user bulk CRUD, comprehensive toggle sweep with log verification, Wiegand/RF registration flows |
| Web UI (Playwright) | suites/ui-playwright.mjs | 32 | Every checkbox on both channels, PIN user CRUD, tab navigation, WiFi/Server forms |
| Physical Hardware | suites/physical-hardware.mjs | 11 | Interactive: exit buttons, contacts, keypads, fobs, RFID scan, motion, buzzer |
The runner automatically finds the device:
Connect to the device's WiFi AP (ac_xxxx, password pyfitech) or set DEVICE_URL.
The stress-bulk suite verifies that every arm/disarm action produces a corresponding log entry on the controller with the correct source tag ([api], [exit_auto], [fob_auto], etc.).
After each run, test-report.html is generated with:
Requires hardware connected. Each test:
npm run test:physicaltests/ ├── runner.mjs # Main entry point ├── package.json # npm config ├── lib/ │ ├── api-client.mjs # Full API client (28 endpoints) │ ├── config.mjs # Device URL, timeouts │ └── report.mjs # HTML report generator ├── suites/ │ ├── api-state.mjs # GET state/monitoring tests │ ├── api-config.mjs # POST config toggle tests │ ├── stress-bulk.mjs # Bulk CRUD + toggle sweep │ ├── ui-playwright.mjs # Browser UI tests │ └── physical-hardware.mjs # Interactive hardware tests └── test-report.html # Generated report
| Back | FazBrowse Home | New Git URL |