towerops/e2e/tests
Graham McIntire 6fd03ace16
feat: add comprehensive wireless client tracking and monitoring
Implements real-time wireless client monitoring with historical tracking,
LiveView UI, proactive alerting, and cross-browser e2e tests.

Phase 1: Historical Tracking
- Add TimescaleDB hypertable for wireless_client_readings
- Batch insert client metrics every 60 seconds from DevicePollerWorker
- 90-day retention with compression after 7 days
- Continuous aggregates for hourly (1 year) and daily (5 years) rollups

Phase 2: LiveView UI
- Add wireless tab to device detail page
- Real-time client list with PubSub updates
- Signal strength and SNR badges with 5-level thresholds
- Display MAC, IP, subscriber, TX/RX rates, distance, uptime
- Subscriber matching via device_subscriber_links
- Empty state handling

Phase 3: Proactive Alerting
- WirelessInsightWorker runs every 5 minutes via Oban cron
- 4 insight types with auto-resolution:
  * wireless_signal_weak: < -75 dBm (warning), < -85 dBm (critical)
  * wireless_snr_low: < 15 dB (warning), < 10 dB (critical)
  * wireless_ap_overloaded: > 50 clients (warning), > 75 clients (critical)
  * wireless_client_missing: expected subscribers not connecting
- Hysteresis thresholds prevent alert flapping
- Multi-organization isolation with proper deduplication

Code Quality:
- Refactored reload_current_tab_data to reduce cyclomatic complexity
- Combined double Enum.filter into single pass for efficiency
- Fixed length/1 comparison to use empty list check
- All Credo checks passing

Testing:
- 28 unit tests (ExUnit) - 100% passing
- 15 e2e tests (Playwright) - 100% passing across chromium/firefox/webkit
- Total: 73 tests, all passing

Files changed:
- lib/towerops/workers/wireless_insight_worker.ex (NEW)
- lib/towerops_web/live/device_live/show.ex (wireless tab + refactoring)
- lib/towerops_web/live/device_live/show.html.heex (wireless template)
- lib/towerops/snmp.ex (5 new query functions)
- lib/towerops/gaiia.ex (list_missing_subscribers)
- lib/towerops/preseem/insight.ex (5 new insight types)
- config/runtime.exs (Oban cron schedule)
- test/support/fixtures/snmp_fixtures.ex (NEW)
- test/towerops/workers/wireless_insight_worker_test.exs (NEW)
- test/towerops_web/live/device_live/show_test.exs (9 new tests)
- e2e/tests/wireless-clients.spec.ts (NEW - 15 cross-browser tests)
2026-03-10 09:57:12 -05:00
..
accessibility.spec.ts feat: add advanced e2e tests for UX and accessibility 2026-03-06 17:16:25 -06:00
activity-feed.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
agent-tokens.spec.ts feat: add comprehensive e2e tests for workflows and validation 2026-03-06 17:12:46 -06:00
agents.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
alert-workflows.spec.ts fix: use correct secret names for container registry login 2026-03-08 14:57:47 -05:00
alerts.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
api-tokens.spec.ts feat: add critical e2e tests for robustness and security 2026-03-06 17:21:14 -06:00
auth-flows.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
auth.setup.ts fix: NimbleTOTP base32 decoding and complete e2e test setup 2026-03-06 16:42:41 -06:00
config-timeline.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
dashboard.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
data-integrity.spec.ts feat: add critical e2e tests for robustness and security 2026-03-06 17:21:14 -06:00
device-graphs.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
devices.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
error-scenarios.spec.ts feat: add critical e2e tests for robustness and security 2026-03-06 17:21:14 -06:00
form-validation.spec.ts feat: add comprehensive e2e tests for workflows and validation 2026-03-06 17:12:46 -06:00
help.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
helpers.ts feat: add Playwright e2e test suite 2026-03-06 15:02:56 -06:00
insights.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
integrations.spec.ts feat: add comprehensive e2e tests for workflows and validation 2026-03-06 17:12:46 -06:00
maintenance.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
maps.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
mikrotik-backup-compare.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
mikrotik-backups.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
navigation-routing.spec.ts feat: add critical e2e tests for robustness and security 2026-03-06 17:21:14 -06:00
notifications.spec.ts feat: add advanced e2e tests for UX and accessibility 2026-03-06 17:16:25 -06:00
onboarding.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
organization-settings.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
organizations.spec.ts fix: NimbleTOTP base32 decoding and complete e2e test setup 2026-03-06 16:42:41 -06:00
pagination-sorting.spec.ts feat: add advanced e2e tests for UX and accessibility 2026-03-06 17:16:25 -06:00
real-time-updates.spec.ts feat: add advanced e2e tests for UX and accessibility 2026-03-06 17:16:25 -06:00
search-filtering.spec.ts feat: add critical e2e tests for robustness and security 2026-03-06 17:21:14 -06:00
search.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
session-management.spec.ts feat: add advanced e2e tests for UX and accessibility 2026-03-06 17:16:25 -06:00
signup-flow.spec.ts.disabled fix: disable problematic signup-flow tests and adjust e2e timeouts 2026-03-09 11:12:10 -05:00
signup-flow.spec.ts.skip fix: disable problematic signup-flow tests and adjust e2e timeouts 2026-03-09 11:12:10 -05:00
sites-map.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
sites.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
smoke-test.spec.ts test: add comprehensive smoke tests for all pages 2026-03-06 17:36:54 -06:00
snmp-config.spec.ts feat: add comprehensive e2e tests for workflows and validation 2026-03-06 17:12:46 -06:00
status-indicator.spec.ts fix: NimbleTOTP base32 decoding and complete e2e test setup 2026-03-06 16:42:41 -06:00
team.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
trace.spec.ts feat: add remaining e2e tests and fix 'too many open files' error 2026-03-06 17:08:27 -06:00
user-settings.spec.ts feat: comprehensive e2e test coverage for all user-facing features 2026-03-06 16:58:06 -06:00
wireless-clients.spec.ts feat: add comprehensive wireless client tracking and monitoring 2026-03-10 09:57:12 -05:00