diff options
| author | Your Name <you@example.com> | 2026-05-16 11:56:43 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-16 11:56:43 +0530 |
| commit | 38aa9ec3801f5895e09866fe92cb8e44fb987cee (patch) | |
| tree | c702c27cd59fa0e73bc3e8665e1582e6b9509cf6 /tests/captive-portal.spec.mjs | |
| parent | ee4e13680f522253f94e8ebdea5df80332afc495 (diff) | |
Unique SSID/IP per board + captive detection fix + mint list in portal
- Derive unique SSID (TollGate-{MAC4}{MAC5}) and AP IP (10.{b5}.{subnet}.1)
from factory MAC — boards no longer conflict
- Board A: TollGate-377C @ 10.55.85.1, Board B: TollGate-5050 @ 10.80.10.1
- Captive portal detection URIs return 200 with portal HTML (matching
esp32-mesh working approach) instead of 302 redirect
- Dynamic AP IP in portal HTML via __AP_IP__ template substitution
- Supported mints section in portal page (shows mint URL, tap to copy)
- Fixed mint URL to testnut.cashu.space (was stale in SPIFFS)
- DoT reject server on port 853 for DNS-over-TLS fallback
- DNS hijack: NXDOMAIN for all non-A queries, no forwarding for unauthed
- Playwright tests updated for 200 response on detection URIs
- Phase 2 test suite: 20/21 pass (test 22 expiry ping route issue)
- Tests 25-27 deferred to Phase 3 (Board B as second client)
Diffstat (limited to 'tests/captive-portal.spec.mjs')
| -rw-r--r-- | tests/captive-portal.spec.mjs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/captive-portal.spec.mjs b/tests/captive-portal.spec.mjs index acd2a40..bc7a1fa 100644 --- a/tests/captive-portal.spec.mjs +++ b/tests/captive-portal.spec.mjs | |||
| @@ -32,18 +32,18 @@ test.describe('Captive Portal - Phase 2', () => { | |||
| 32 | await expect(btn).toHaveText(/Pay/); | 32 | await expect(btn).toHaveText(/Pay/); |
| 33 | }); | 33 | }); |
| 34 | 34 | ||
| 35 | test('captive detection URIs return 302 redirect', async ({ request }) => { | 35 | test('captive detection URIs return portal HTML (200)', async ({ request }) => { |
| 36 | const uris = ['/generate_204', '/hotspot-detect.html', '/canonical.html', '/success.txt']; | 36 | const uris = ['/generate_204', '/hotspot-detect.html', '/canonical.html', '/success.txt']; |
| 37 | for (const uri of uris) { | 37 | for (const uri of uris) { |
| 38 | const resp = await request.fetch(`${PORTAL_URL}${uri}`, { maxRedirects: 0, ignoreHTTPSErrors: true }); | 38 | const resp = await request.fetch(`${PORTAL_URL}${uri}`); |
| 39 | expect(resp.status()).toBe(302); | 39 | expect(resp.status()).toBe(200); |
| 40 | const location = resp.headers()['location']; | 40 | const body = await resp.text(); |
| 41 | expect(location).toBe('http://192.168.4.1/'); | 41 | expect(body).toContain('TollGate'); |
| 42 | } | 42 | } |
| 43 | }); | 43 | }); |
| 44 | 44 | ||
| 45 | test('captive detection redirects to portal page', async ({ page }) => { | 45 | test('catch-all URIs redirect to portal page', async ({ page }) => { |
| 46 | await page.goto(`${PORTAL_URL}/generate_204`); | 46 | await page.goto(`${PORTAL_URL}/some-random-page`); |
| 47 | await expect(page.locator('h1')).toHaveText('TollGate'); | 47 | await expect(page.locator('h1')).toHaveText('TollGate'); |
| 48 | }); | 48 | }); |
| 49 | 49 | ||