From 122cf09591f9c9331e5316ba4e4227098f5b8ca3 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 28 Oct 2026 16:18:19 +0100 Subject: [PATCH] Klon: Kettentest mit unseren Werkzeugen, Text-Klickbarkeit, echte Klassen - tests/mock_spec.py: Kettentest cdp.mjs -> fenster.py -> click.py -> runner.py --live --act, belegt ueber nachsehen (ab fenster.py nur macOS); Pruefung, dass jedes Bedienelement per Text einen Knopf trifft - Seiten: + ohne Huelle, Buy-In-Ueberschrift als h2, Knoepfe als `; r.querySelector(".game-info").textContent = t.id; r.querySelector("button").addEventListener("click", () => { @@ -106,7 +109,10 @@ async function laden() { let r = liste.querySelector(`[data-table-id="${CSS.escape(t.id)}"]`); if (!r) { r = zeile(t); liste.appendChild(r); } r.querySelector(".avg-stack").textContent = t.schnitt; - r.querySelector(".players").textContent = `${t.spieler}/6`; + r.querySelector(".player-count").textContent = `${t.spieler}/6`; + const sitze = r.querySelector(".table-seat-progress"); + sitze.innerHTML = Array.from({length: 6}, (_, i) => + ``).join(""); } } catch (e) { /* Server weg - nichts zu tun */ } } diff --git a/mock/seiten/table.html b/mock/seiten/table.html index 37a8359..33115a5 100644 --- a/mock/seiten/table.html +++ b/mock/seiten/table.html @@ -37,19 +37,21 @@ .betrag { position: absolute; transform: translate(-50%, -50%); width: 9vw; height: 4.4vh; text-align: center; background: #0d0f15; color: #fff; border: 1px solid #333; border-radius: 6px; } .dialog-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: none; } - .sfs-buy-in-modal { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: 380px; + .sfs-buy-in-modal { position: absolute; width: 380px; box-sizing: border-box; background: #1b1e29; border-radius: 12px; padding: 18px; display: none; } .sfs-buy-in-header { display: flex; justify-content: space-between; align-items: center; } - .sfs-buy-in-heading { font-size: 20px; font-weight: 700; } + .sfs-buy-in-heading { font-size: 20px; font-weight: 700; margin: 0; } .sfs-buy-in-header-game-info { color: #99a; margin: 6px 0 14px; } .sfs-buy-in-balance-container { display: flex; justify-content: space-between; margin-bottom: 12px; } .sfs-buy-in-user-balance { color: #f5c542; font-weight: 700; } .sfs-slider-range-value { width: 100%; box-sizing: border-box; padding: 8px; font-size: 18px; text-align: center; background: #0d0f15; color: #fff; border: 1px solid #333; border-radius: 6px; } .sfs-buy-in-body-range-buttons { display: flex; justify-content: space-between; margin: 10px 0 16px; } - .sfs-buy-in-body-range-buttons [role=button], .sfs-buy-in-modal-button { - background: #2b3045; border-radius: 6px; padding: 6px 16px; cursor: pointer; } - .sfs-buy-in-modal-button { background: #1fae64; text-align: center; font-weight: 700; padding: 10px; } + .sfs-buy-in-body-range-buttons button, .sfs-buy-in-modal-button { + background: #2b3045; color: #fff; border: 0; border-radius: 6px; padding: 6px 16px; cursor: pointer; + font: inherit; } + .sfs-buy-in-modal-button-container { padding: 6px 40px; } + .sfs-buy-in-modal-button { background: #1fae64; font-weight: 700; padding: 10px; width: 100%; } .sfs-buy-in-body-error { color: #ff6b6b; min-height: 1em; font-size: 12px; } .common-dialog-cross-icon { cursor: pointer; font-size: 22px; } @@ -67,7 +69,7 @@
-
Buy-In
+

Buy-In

×
{{TITEL}}
@@ -78,19 +80,20 @@
-
Min
-
Max
+ +
-
Buy-In
+
diff --git a/mock/start.py b/mock/start.py index 75114ce..60bc38a 100644 --- a/mock/start.py +++ b/mock/start.py @@ -68,6 +68,22 @@ def chrome_starten(pfad, cdp_port, url, headless): raise SystemExit(f"Chrome antwortet nicht am Debug-Port {cdp_port}") +def reste(profil): + """PIDs aller Prozesse, deren Befehlszeile den Profilordner nennt - Chrome samt Helfern. + + Die eine PID reicht nicht: ein Chrome kann Helfer überleben lassen, und unter + Windows lässt sich ein Chrome-Prozess nicht zuverlässig nach seinem Zustand fragen. + """ + if sys.platform == "win32": + befehl = ["powershell", "-NoProfile", "-Command", + "Get-CimInstance Win32_Process | Where-Object { $_.ProcessId -ne $PID -and " + f"$_.CommandLine -like '*{profil}*' }} | ForEach-Object {{ $_.ProcessId }}"] + else: + befehl = ["pgrep", "-f", "--", profil] + r = subprocess.run(befehl, capture_output=True, text=True) + return [int(p) for p in r.stdout.split() if p.isdigit() and int(p) != os.getpid()] + + def chrome_beenden(proc, profil, cdp_port): try: with cdp.Verbindung(cdp.browser_ws(cdp_port), frist=3) as b: @@ -79,6 +95,16 @@ def chrome_beenden(proc, profil, cdp_port): except subprocess.TimeoutExpired: proc.kill() proc.wait() + for _ in range(10): + uebrig = reste(profil) + if not uebrig: + break + for pid in uebrig: + try: + os.kill(pid, signal.SIGTERM if sys.platform == "win32" else signal.SIGKILL) + except OSError: + pass + time.sleep(0.3) for _ in range(50): # Windows gibt Dateien erst nach und nach frei shutil.rmtree(profil, ignore_errors=True) if not os.path.exists(profil): diff --git a/tests/mock_spec.py b/tests/mock_spec.py index c1d7e75..6e87f61 100644 --- a/tests/mock_spec.py +++ b/tests/mock_spec.py @@ -11,8 +11,15 @@ Werkzeuge es täten: * eine Hand läuft und hält am eigenen Zug an * ein Mausklick an der README-Stelle von `Call` wird geschrieben und von hand/nachsehen.py belegt + * jedes bedienbare Element ist über seinen Text erreichbar (Auswahl wie + lobby/cdp.mjs --click) und trifft einen