test: Chat-Oberfläche als Chromium-Regressionstest, alte Browsertests repariert, JS-Tests in der CI (A8, #1195, #1196)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg7qE8FdhchzsBrwgjZ
This commit is contained in:
@ -3,8 +3,11 @@ const BASE = process.env.NEXUS_BASE || 'http://127.0.0.1:18112';
|
||||
const S = process.argv[2]; const pw = process.argv[3]; const tag = process.argv[4];
|
||||
const b = await start();
|
||||
const pruefen = `(async () => {
|
||||
const sicht = e => { const s = getComputedStyle(e); const r = e.getBoundingClientRect(); return s.visibility !== 'hidden' && s.display !== 'none' && r.width > 0 && r.height > 0; };
|
||||
const ziele = Array.from(document.querySelectorAll('#chat button, #chat select, #chat textarea, #chat input, .chat-seite button, .chat-seite input, header a, header button')).filter(sicht);
|
||||
// Der Inhalt eines geschlossenen details hat in Chromium eine Größe, wird aber nicht angezeigt: checkVisibility() (seit A1, #1195).
|
||||
const sicht = e => { const s = getComputedStyle(e); const r = e.getBoundingClientRect(); return s.visibility !== 'hidden' && s.display !== 'none' && r.width > 0 && r.height > 0 && e.checkVisibility(); };
|
||||
// Ist die Seitenleiste auf dem Smartphone als Overlay offen, soll der Rest abgedunkelt und nicht bedienbar sein: dann zählt nur die Seitenleiste.
|
||||
const overlay = document.getElementById('chat-rahmen').classList.contains('offen');
|
||||
const ziele = Array.from(document.querySelectorAll(overlay ? '.chat-seite button, .chat-seite input' : '#chat button, #chat select, #chat textarea, #chat input, .chat-seite button, .chat-seite input, header a, header button')).filter(sicht);
|
||||
const probleme = []; let n = 0;
|
||||
for (const e of ziele) {
|
||||
e.scrollIntoView({ block: 'center', inline: 'nearest' });
|
||||
@ -26,8 +29,9 @@ try {
|
||||
for (const [w, h, sidebar, name] of fall) {
|
||||
await b.viewport(w, h, { dsf: 1, mobile: w < 700 });
|
||||
await b.goto(BASE + '/ui/chat');
|
||||
// Seitenleiste: mobil ist sie standardmäßig zu (display:none ohne Klasse), „Verlauf ein/aus“ schaltet; Desktop: offen, true = zuklappen
|
||||
if (sidebar) await b.eval(`document.getElementById('chat-seite-knopf').click(); 1`);
|
||||
// Seitenleiste: mobil ist sie standardmäßig zu (Overlay, Klasse „offen“ zeigt sie); Desktop: offen, true = zuklappen
|
||||
// Smartphone: das Overlay öffnet der Knopf im Kopf; Desktop: der Knopf in der Seitenleiste klappt sie zu.
|
||||
if (sidebar) await b.eval(`document.getElementById(innerWidth <= 640 ? 'chat-seite-oeffnen' : 'chat-seite-knopf').click(); 1`);
|
||||
await new Promise(r => setTimeout(r, 200));
|
||||
console.log(name.padEnd(28), await b.eval(pruefen));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user