mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
feat: inject 800ms pauses between test actions for readable videos
Regex inserts await page.waitForTimeout(800) before every comfyPage/topbar/page/canvas/expect await call in the Phase 2 test code. Adds ~5-8s to a 10-step test (negligible vs 10min research). Default playback changed to 0.5x (was 0.25x) since pauses provide natural breathing room. A 15s video at 0.5x = 30s viewing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1991,6 +1991,11 @@ async function main() {
|
||||
'\n' +
|
||||
testCode.slice(insertPos)
|
||||
}
|
||||
// Inject 800ms pauses between actions for human-readable video
|
||||
testCode = testCode.replace(
|
||||
/(\n\s*)(await\s+(?:comfyPage|topbar|page|canvas|expect))/g,
|
||||
'$1await page.waitForTimeout(800);\n$1$2'
|
||||
)
|
||||
writeFileSync(browserTestFile, testCode)
|
||||
try {
|
||||
const output = execSync(
|
||||
|
||||
@@ -92,7 +92,7 @@ function copyBadge(){const u=location.href.replace(/\/[^/]*$/,'/');const b=u+'ba
|
||||
document.querySelectorAll('[data-md]').forEach(el=>{const t=el.textContent;el.removeAttribute('data-md');el.innerHTML=marked.parse(t)});
|
||||
const FPS=30,FT=1/FPS,SPEEDS=[0.1,0.25,0.5,1,1.5,2];
|
||||
document.querySelectorAll('.video-wrap video').forEach(v=>{
|
||||
v.playbackRate=0.25;v.removeAttribute('autoplay');v.pause();
|
||||
v.playbackRate=0.5;v.removeAttribute('autoplay');v.pause();
|
||||
const c=document.createElement('div');c.className='vctrl';
|
||||
const btn=(label,fn)=>{const b=document.createElement('button');b.textContent=label;b.onclick=fn;c.appendChild(b);return b};
|
||||
const sep=()=>{const s=document.createElement('div');s.className='vsep';c.appendChild(s)};
|
||||
@@ -104,7 +104,7 @@ document.querySelectorAll('.video-wrap video').forEach(v=>{
|
||||
btn('\u25B6\u25B6',()=>{v.pause();v.currentTime+=FT});
|
||||
btn('\u25B6\u25B6\u25B6',()=>{v.currentTime+=FT*10});
|
||||
sep();
|
||||
const spdBtns=SPEEDS.map(s=>{const b=btn(s+'x',()=>{v.playbackRate=s;spdBtns.forEach(x=>x.classList.remove('active'));b.classList.add('active')});if(s===0.25)b.classList.add('active');return b});
|
||||
const spdBtns=SPEEDS.map(s=>{const b=btn(s+'x',()=>{v.playbackRate=s;spdBtns.forEach(x=>x.classList.remove('active'));b.classList.add('active')});if(s===0.5)b.classList.add('active');return b});
|
||||
sep();c.appendChild(time);
|
||||
const hint=document.createElement('span');hint.className='vhint';hint.textContent='\u2190\u2192 frame \u2022 space play';c.appendChild(hint);
|
||||
// Custom seekbar — works even without server range request support
|
||||
|
||||
Reference in New Issue
Block a user