fix: Vorlesen bei ausgefallenem Studio meldet das verständlich (503, JSON); Tests browser2vorlesen.3, browser2stimmen.6, admin2enginefenster.3; Version 0.1.17-rc3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg6sxZ8wsKZAVLQ6Xj5
This commit is contained in:
15
scripts/ui-pruefung/enginefenster.mjs
Normal file
15
scripts/ui-pruefung/enginefenster.mjs
Normal file
@ -0,0 +1,15 @@
|
||||
// admin2enginefenster.3: Fenster-Symbole auf der Engines-Seite (llama.cpp gestrichelt, ohne Link; Studio mit Link), Klick auf das gestrichelte tut nichts. Aufruf: node enginefenster.mjs <Passwort>
|
||||
import * as cdp from './lib.mjs';
|
||||
import fs from 'node:fs';
|
||||
const BASE=process.env.NEXUS_BASE||'http://127.0.0.1:18121', pw=process.argv[2];
|
||||
const b=await cdp.start({port:9364});
|
||||
try{ await b.login(BASE,'claude',pw); await b.goto(BASE+'/ui/engines'); await new Promise(r=>setTimeout(r,1000));
|
||||
console.log(JSON.stringify(await b.eval(`[...document.querySelectorAll('.fenster')].map(f=>{const card=f.closest('section,article,.card,tr,div[class*=karte]');const el=f.firstElementChild;const cs=getComputedStyle(el);return {engine:(card?card.innerText.slice(0,20).replace(/\\n/g,' '):'?'),tag:el.tagName,href:el.getAttribute('href'),title:el.getAttribute('title')||el.querySelector('title')?.textContent||el.getAttribute('aria-label'),border:cs.borderTopStyle,cursor:cs.cursor,klasse:el.className&&el.className.baseVal!==undefined?el.className.baseVal:el.className}})`),null,1));
|
||||
const llama=await b.eval(`(()=>{const f=[...document.querySelectorAll('.fenster')][0];const r=f.getBoundingClientRect();return [r.x+r.width/2,r.y+r.height/2]})()`);
|
||||
await b.send('Input.dispatchMouseEvent',{type:'mouseMoved',x:llama[0],y:llama[1]});
|
||||
await b.send('Input.dispatchMouseEvent',{type:'mousePressed',x:llama[0],y:llama[1],button:'left',clickCount:1});
|
||||
await b.send('Input.dispatchMouseEvent',{type:'mouseReleased',x:llama[0],y:llama[1],button:'left',clickCount:1});
|
||||
await new Promise(r=>setTimeout(r,800));
|
||||
console.log('URL nach Klick:', await b.eval('location.pathname'), '| Seiten/Tabs:', (await (await fetch('http://127.0.0.1:9364/json')).json()).filter(t=>t.type==='page').length);
|
||||
await b.shot('/tmp/fenster3.png');
|
||||
}finally{b.close();}
|
||||
Reference in New Issue
Block a user