diff --git a/_audit/playwright_20260505_0924/01_login_page.png b/_audit/playwright_20260505_0924/01_login_page.png new file mode 100644 index 0000000..f1cfde1 Binary files /dev/null and b/_audit/playwright_20260505_0924/01_login_page.png differ diff --git a/_audit/playwright_20260505_0924/02_post_login.png b/_audit/playwright_20260505_0924/02_post_login.png new file mode 100644 index 0000000..e185e40 Binary files /dev/null and b/_audit/playwright_20260505_0924/02_post_login.png differ diff --git a/_audit/playwright_20260505_0924/03_app_dashboard.png b/_audit/playwright_20260505_0924/03_app_dashboard.png new file mode 100644 index 0000000..e185e40 Binary files /dev/null and b/_audit/playwright_20260505_0924/03_app_dashboard.png differ diff --git a/_audit/playwright_20260505_0924/04_profile_view.png b/_audit/playwright_20260505_0924/04_profile_view.png new file mode 100644 index 0000000..05f349e Binary files /dev/null and b/_audit/playwright_20260505_0924/04_profile_view.png differ diff --git a/_audit/playwright_20260505_0924/05_post_logout.png b/_audit/playwright_20260505_0924/05_post_logout.png new file mode 100644 index 0000000..325736d Binary files /dev/null and b/_audit/playwright_20260505_0924/05_post_logout.png differ diff --git a/_audit/playwright_20260505_0924/m01_mobile_login.png b/_audit/playwright_20260505_0924/m01_mobile_login.png new file mode 100644 index 0000000..c341aea Binary files /dev/null and b/_audit/playwright_20260505_0924/m01_mobile_login.png differ diff --git a/_audit/playwright_20260505_0924/m02_mobile_app.png b/_audit/playwright_20260505_0924/m02_mobile_app.png new file mode 100644 index 0000000..a087711 Binary files /dev/null and b/_audit/playwright_20260505_0924/m02_mobile_app.png differ diff --git a/_audit/playwright_20260505_0924/m03_mobile_sidebar_open.png b/_audit/playwright_20260505_0924/m03_mobile_sidebar_open.png new file mode 100644 index 0000000..92f9f2d Binary files /dev/null and b/_audit/playwright_20260505_0924/m03_mobile_sidebar_open.png differ diff --git a/_audit/playwright_20260505_0924/m04_mobile_sport2_homepage.png b/_audit/playwright_20260505_0924/m04_mobile_sport2_homepage.png new file mode 100644 index 0000000..8dd170a Binary files /dev/null and b/_audit/playwright_20260505_0924/m04_mobile_sport2_homepage.png differ diff --git a/_audit/playwright_20260505_0924/results.json b/_audit/playwright_20260505_0924/results.json new file mode 100644 index 0000000..c7e7413 --- /dev/null +++ b/_audit/playwright_20260505_0924/results.json @@ -0,0 +1,66 @@ +{ + "tests": [ + { + "name": "Login page loads", + "status": "PASS" + }, + { + "name": "Login persists JWT", + "status": "PASS", + "url": "https://sport.rinet.one/app", + "token_len": 519 + }, + { + "name": "Profile section accessible", + "status": "PASS" + }, + { + "name": "PGŽ logo clickable", + "status": "PASS", + "href": "/" + }, + { + "name": "Logout clears tokens", + "status": "PASS" + }, + { + "name": "Mobile login renders", + "status": "PASS", + "viewport": "width=device-width,initial-scale=1" + }, + { + "name": "Mobile login → app", + "status": "PASS" + }, + { + "name": "Mobile hamburger button", + "status": "PASS", + "visible": true + }, + { + "name": "Mobile sidebar opens", + "status": "PASS" + }, + { + "name": "Mobile homepage no horizontal scroll", + "status": "PASS", + "body_w": 375, + "viewport": 375 + } + ], + "screenshots": [ + "/opt/pgz-sport/_audit/playwright_20260505_0924/01_login_page.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/02_post_login.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/03_app_dashboard.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/04_profile_view.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/05_post_logout.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/m01_mobile_login.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/m02_mobile_app.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/m03_mobile_sidebar_open.png", + "/opt/pgz-sport/_audit/playwright_20260505_0924/m04_mobile_sport2_homepage.png" + ], + "summary": { + "passed": 10, + "failed": 0 + } +} \ No newline at end of file diff --git a/scripts/playwright_e2e.py b/scripts/playwright_e2e.py index 68fc906..34da438 100755 --- a/scripts/playwright_e2e.py +++ b/scripts/playwright_e2e.py @@ -120,6 +120,8 @@ def test_desktop(pw): # 5. Logout try: + # Register confirm() handler — auto-accept + page.on('dialog', lambda d: d.accept()) # Click the logout button (⎋ icon) # Find a visible logout element across all known selectors logout_btn = None @@ -139,7 +141,10 @@ def test_desktop(pw): }""") if res: print(f' [debug] logout invoked via JS: {res}') - time.sleep(2) + # Wait for async logout (POST /auth/logout + clear + redirect) + try: page.wait_for_url('**/login**', timeout=10000) + except: pass + time.sleep(1) logout_btn = 'js' # sentinel if logout_btn is not None: if hasattr(logout_btn, 'click'):