skopix 2.0.86 → 2.0.88

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/web/app/index.html +41 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skopix",
3
- "version": "2.0.86",
3
+ "version": "2.0.88",
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": {
@@ -7370,11 +7370,27 @@ function mergeDebugSteps(newSteps) {
7370
7370
  });
7371
7371
  }
7372
7372
 
7373
- function insertAndOpenEditor(stepsToInsert) {
7373
+ async function insertAndOpenEditor(stepsToInsert) {
7374
7374
  const insertAt = debugRecordingState.insertAfterIndex + 1;
7375
- reEditorState.steps.splice(insertAt, 0, ...stepsToInsert);
7376
7375
 
7377
- appendRunLine('<span style="color:var(--green)">\u2713 ' + stepsToInsert.length + ' steps inserted at position ' + (insertAt + 1) + '</span>');
7376
+ // Process new steps through LLM for stable selectors
7377
+ appendRunLine('<span style="color:var(--muted)">Processing new steps...</span>');
7378
+ let processedSteps = stepsToInsert;
7379
+ try {
7380
+ const procRes = await fetch(API_BASE + '/api/record/process', {
7381
+ method: 'POST',
7382
+ headers: { 'Content-Type': 'application/json' },
7383
+ body: JSON.stringify({ steps: stepsToInsert, testName: reEditorState.testName, url: reEditorState.url }),
7384
+ });
7385
+ if (procRes.ok) {
7386
+ const proc = await procRes.json();
7387
+ processedSteps = proc.steps || stepsToInsert;
7388
+ }
7389
+ } catch {}
7390
+
7391
+ reEditorState.steps.splice(insertAt, 0, ...processedSteps);
7392
+
7393
+ appendRunLine('<span style="color:var(--green)">\u2713 ' + processedSteps.length + ' steps inserted at position ' + (insertAt + 1) + '</span>');
7378
7394
  appendRunLine('<span style="color:var(--muted)">Opening editor — review and save when ready</span>');
7379
7395
 
7380
7396
  setTimeout(() => {
@@ -7383,7 +7399,7 @@ function insertAndOpenEditor(stepsToInsert) {
7383
7399
  document.getElementById('re-url').value = reEditorState.url;
7384
7400
  document.getElementById('re-reusable').checked = reEditorState.reusable || false;
7385
7401
  renderReSteps();
7386
- showToast(stepsToInsert.length + ' steps added — review and save');
7402
+ showToast(processedSteps.length + ' steps added — review and save');
7387
7403
  }, 800);
7388
7404
  }
7389
7405
  function reAddAssertion() { reAddAssertionAfter(reEditorState.steps.length-1); }
@@ -7594,7 +7610,27 @@ async function saveRecordedTest() {
7594
7610
  const scope=document.getElementById('results-scope').value;
7595
7611
  if (!name) { showToast('Please enter a test name'); return; }
7596
7612
  try {
7597
- const res=await fetch(API_BASE+'/api/record/save',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name,scope,url:recorderState.startUrl,steps:recorderState.steps,playwrightJs:recorderState.playwrightJs,playwrightTs:recorderState.playwrightTs})});
7613
+ // Process steps through LLM first to get stable selectors, then save
7614
+ let steps = recorderState.steps;
7615
+ let playwrightJs = recorderState.playwrightJs;
7616
+ let playwrightTs = recorderState.playwrightTs;
7617
+ if (steps && steps.length && !playwrightJs) {
7618
+ showToast('Processing steps...');
7619
+ try {
7620
+ const procRes = await fetch(API_BASE + '/api/record/process', {
7621
+ method: 'POST',
7622
+ headers: { 'Content-Type': 'application/json' },
7623
+ body: JSON.stringify({ steps, testName: name, url: recorderState.startUrl }),
7624
+ });
7625
+ if (procRes.ok) {
7626
+ const proc = await procRes.json();
7627
+ steps = proc.steps || steps;
7628
+ playwrightJs = proc.playwrightJs || playwrightJs;
7629
+ playwrightTs = proc.playwrightTs || playwrightTs;
7630
+ }
7631
+ } catch {}
7632
+ }
7633
+ const res=await fetch(API_BASE+'/api/record/save',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name,scope,url:recorderState.startUrl,steps,playwrightJs,playwrightTs})});
7598
7634
  const data=await res.json();
7599
7635
  if (!res.ok) { showToast(data.error||'Failed'); return; }
7600
7636
  showToast('Saved: '+name);