skopix 2.0.62 → 2.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1836,6 +1836,11 @@ export async function dashboardCommand(options) {
1836
1836
  sendJSON(res, 200, { stopped: true });
1837
1837
  return;
1838
1838
  }
1839
+ if (pathname.match(/^\/api\/step-tester\/[^/]+\/status$/) && method === 'GET') {
1840
+ const testerId = pathname.split('/')[3];
1841
+ sendJSON(res, 200, { active: stepTesterSessions.has(testerId) });
1842
+ return;
1843
+ }
1839
1844
 
1840
1845
  // ─── STEP LIBRARY ──────────────────────────────────────────────────
1841
1846
  if (pathname === '/api/step-library' && method === 'GET') {
@@ -3990,6 +3995,9 @@ async function startStepTester(testerId, url, selector, mode, steps) {
3990
3995
  window.__skopixPreviewResults = {};
3991
3996
  document.addEventListener('DOMContentLoaded', () => {
3992
3997
  if (document.getElementById('__skopix_preview')) return;
3998
+ // Push page content left to avoid covering elements
3999
+ document.body.style.marginRight = '320px';
4000
+ document.body.style.boxSizing = 'border-box';
3993
4001
  const tb = document.createElement('div');
3994
4002
  tb.id = '__skopix_preview';
3995
4003
  tb.style.cssText = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skopix",
3
- "version": "2.0.62",
3
+ "version": "2.0.64",
4
4
  "description": "Browser-based QA tool — record tests by using your app, replay them deterministically, generate Playwright code automatically",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -6422,9 +6422,27 @@ async function startBuilderPreview() {
6422
6422
  const data = await res.json();
6423
6423
  if (!res.ok) throw new Error(data.error || 'Failed');
6424
6424
  previewState.testerId = data.testerId;
6425
+ btn.disabled = false;
6425
6426
  btn.textContent = '⏸ Previewing';
6426
6427
  btn.onclick = stopBuilderPreview;
6427
6428
  showToast('Browser open — use the toolbar in the browser to run steps');
6429
+
6430
+ // Poll until session ends (browser closed via Stop button in browser)
6431
+ const poll = setInterval(async () => {
6432
+ if (!previewState.testerId) { clearInterval(poll); return; }
6433
+ try {
6434
+ const r = await fetch(API_BASE + '/api/step-tester/' + previewState.testerId + '/status');
6435
+ const d = await r.json();
6436
+ if (!d.active) {
6437
+ clearInterval(poll);
6438
+ previewState.testerId = null;
6439
+ btn.disabled = false;
6440
+ btn.textContent = 'Preview';
6441
+ btn.onclick = startBuilderPreview;
6442
+ }
6443
+ } catch { clearInterval(poll); }
6444
+ }, 1500);
6445
+
6428
6446
  } catch (err) {
6429
6447
  showToast('Error: ' + err.message);
6430
6448
  btn.disabled = false;