CRISIS V3: definitive apiAuth + mobile hamburger + Playwright E2E test

apiAuth in app.html:
- Pre-checks JWT exp client-side BEFORE making request
- On expired: clears localStorage + redirects /login?reason=expired
- On 401 from server: clears + redirects /login?reason=unauthorized
- Single-flight redirect via window.__pgz_redirecting flag

login.html:
- Toast for ?reason=expired (red) / ?reason=unauthorized (orange)

app.html mobile:
- Hamburger button injected into topbar (.tb)
- Mobile CSS: sidebar slide-in -280→0, backdrop overlay, full-width drill-down
- toggleMobileSidebar() global function
- @media (max-width:768px) display:inline-flex, sidebar fixed pos

scripts/playwright_e2e.py:
- Desktop test (1280x800): login, JWT persist, profile, logo, logout
- Mobile test (375x812 iPhone X): viewport, login flow, hamburger, no h-scroll
- Output: _audit/playwright_<TS>/results.json + screenshots/*.png

Reproducible: TS=YYYYmmdd_HHMM python3 scripts/playwright_e2e.py
This commit is contained in:
2026-05-05 09:21:39 +02:00
parent 8e136351f9
commit dd2f7daaf8
25 changed files with 523 additions and 41 deletions
+15 -14
View File
@@ -14,21 +14,20 @@
"stats": {
"probano": 50,
"succ_wiki_hr": 2,
"succ_wiki_en": 1,
"succ_search_hr": 5,
"succ_search_en": 3,
"applied": 0,
"kandidati": 5,
"succ_wiki_en": 0,
"succ_search_hr": 3,
"succ_search_en": 2,
"applied": 3,
"kandidati": 2,
"zero_match": 45
},
"apply_rows": [],
"candidate_rows": [
"apply_rows": [
{
"id": 4,
"naziv": "Nagrada Grada Čabra",
"predlozeni_url": "https://hr.wikipedia.org/wiki/Nagrada_Grada_Pakraca_(automobilizam)",
"lang": "hr-search",
"confidence": 0.35,
"confidence": 0.9,
"razlog": "Wikipedia HR opensearch 'Nagrada Grada Pakraca (automobilizam)', matches=2"
},
{
@@ -36,7 +35,7 @@
"naziv": "Rally Opatija",
"predlozeni_url": "https://hr.wikipedia.org/wiki/Rally_Opatija",
"lang": "hr",
"confidence": 0.4,
"confidence": 0.95,
"razlog": "Wikipedia HR direct slug, matches=2"
},
{
@@ -44,15 +43,17 @@
"naziv": "Sveti Vid",
"predlozeni_url": "https://hr.wikipedia.org/wiki/Sveti_Vid",
"lang": "hr",
"confidence": 0.4,
"confidence": 0.95,
"razlog": "Wikipedia HR direct slug, matches=2"
},
}
],
"candidate_rows": [
{
"id": 30,
"naziv": "Rijeka kup",
"predlozeni_url": "https://hr.wikipedia.org/wiki/Rijeka_dubrova%C4%8Dka",
"lang": "hr-search",
"confidence": 0.35,
"confidence": 0.75,
"razlog": "Wikipedia HR opensearch 'Rijeka dubrovačka', matches=1"
},
{
@@ -60,9 +61,9 @@
"naziv": "Delta kup",
"predlozeni_url": "https://hr.wikipedia.org/wiki/Delta_Dunava",
"lang": "hr-search",
"confidence": 0.35,
"confidence": 0.75,
"razlog": "Wikipedia HR opensearch 'Delta Dunava', matches=1"
}
],
"ts": "2026-05-05T07:09:59.816086+00:00"
"ts": "2026-05-05T07:20:23.593727+00:00"
}