skopix 2.0.85 → 2.0.86

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.
@@ -1036,11 +1036,13 @@ export async function dashboardCommand(options) {
1036
1036
  const { scope, name, url, steps, playwrightJs, playwrightTs, tags } = JSON.parse(body);
1037
1037
  if (!name) { sendJSON(res, 400, { error: 'name is required' }); return; }
1038
1038
  try {
1039
- const testData = { name, type: 'recorded', url: url || '', steps: steps || [], playwrightJs: playwrightJs || '', playwrightTs: playwrightTs || '', tags: tags || [] };
1039
+ // Match steps against library before saving
1040
+ const matched = await matchStepsToLibrary(suitesDir, steps || []);
1041
+ const testData = { name, type: 'recorded', url: url || '', steps: matched.steps, playwrightJs: playwrightJs || '', playwrightTs: playwrightTs || '', tags: tags || [] };
1040
1042
  const result = await createTest(suitesDir, scope || 'saved', testData);
1041
1043
  if (teamMode && currentUser) { teamMode.db.logAudit({ userId: currentUser.id, action: 'test.created', targetType: 'test', targetId: result.id, metadata: { scope: scope || 'saved', type: 'recorded' } }); }
1042
- // Auto-extract steps to library in background (non-blocking)
1043
- extractStepsToLibrary(suitesDir, steps || [], name).catch(() => {});
1044
+ // Auto-extract unmatched steps to pending review
1045
+ extractStepsToLibrary(suitesDir, matched.steps, name).catch(() => {});
1044
1046
  sendJSON(res, 200, result);
1045
1047
  } catch (err) { sendJSON(res, 400, { error: err.message }); }
1046
1048
  return;
@@ -1575,8 +1577,11 @@ export async function dashboardCommand(options) {
1575
1577
  const body = await readBody(req);
1576
1578
  const data = JSON.parse(body);
1577
1579
  try {
1580
+ // Match steps against library before saving
1581
+ const matched = await matchStepsToLibrary(suitesDir, data.steps || []);
1582
+ data.steps = matched.steps;
1578
1583
  const result = await updateTest(suitesDir, scope, testId, data);
1579
- // Extract any new steps to pending review queue
1584
+ // Extract any new unmatched steps to pending review queue
1580
1585
  extractStepsToLibrary(suitesDir, data.steps || [], data.name || testId).catch(() => {});
1581
1586
  sendJSON(res, 200, result);
1582
1587
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skopix",
3
- "version": "2.0.85",
3
+ "version": "2.0.86",
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": {