10 lines
632 B
JavaScript
10 lines
632 B
JavaScript
// Shared by the console fixtures (modeled pages, not recorded): records every button click (the engine must never click
|
|
// one) and lets a test act as the owner (window.__next() shows the next step, like the owner pressing Next).
|
|
window.__clicks = [];
|
|
document.addEventListener('click', e => { const b = e.target.closest('button'); if (b) window.__clicks.push(b.textContent.trim()); }, true);
|
|
window.__step = 0;
|
|
window.__next = () => {
|
|
const steps = [...document.querySelectorAll('[data-step]')];
|
|
window.__step = Math.min(window.__step + 1, steps.length - 1);
|
|
steps.forEach((s, i) => { s.hidden = i !== window.__step; });
|
|
};
|