@resolveio/server-lib 22.3.123 → 22.3.124
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.
package/package.json
CHANGED
|
@@ -2693,13 +2693,22 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
|
|
|
2693
2693
|
' await client.close().catch(() => undefined);',
|
|
2694
2694
|
' }',
|
|
2695
2695
|
'}',
|
|
2696
|
-
'async function gotoAndSummarize(page, route, screenshotName) {',
|
|
2696
|
+
'async function gotoAndSummarize(page, route, screenshotName, requiredTerms = []) {',
|
|
2697
2697
|
' await page.goto(new URL(route, clientUrl).href, { waitUntil: "domcontentloaded", timeout: 60000 });',
|
|
2698
2698
|
' await page.waitForSelector("body", { timeout: 30000 });',
|
|
2699
|
+
' let summary = await pageSummary(page);',
|
|
2700
|
+
' const deadline = Date.now() + Number(process.env.RESOLVEIO_SUPPORT_QA_ROW_WAIT_MS || 20000);',
|
|
2701
|
+
' while (Date.now() < deadline) {',
|
|
2702
|
+
' summary = await pageSummary(page);',
|
|
2703
|
+
' const body = String(summary.bodyTextSnippet || "");',
|
|
2704
|
+
' const hasTerms = requiredTerms.filter(Boolean).every((term) => new RegExp(String(term).replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&"), "i").test(body));',
|
|
2705
|
+
' if (hasTerms && !isShellOnlySummary(summary)) break;',
|
|
2706
|
+
' await delay(750);',
|
|
2707
|
+
' }',
|
|
2699
2708
|
' await delay(Number(process.env.RESOLVEIO_RUNNER_QA_SCREENSHOT_SETTLE_MS || process.env.RESOLVEIO_SUPPORT_QA_SCREENSHOT_SETTLE_MS || 1000));',
|
|
2700
2709
|
' await page.keyboard.press("Escape").catch(() => undefined);',
|
|
2701
2710
|
' await delay(750);',
|
|
2702
|
-
'
|
|
2711
|
+
' summary = await pageSummary(page);',
|
|
2703
2712
|
' const screenshot = path.join(artifactDir, screenshotName);',
|
|
2704
2713
|
' await page.screenshot({ path: screenshot, type: "jpeg", quality: 82, fullPage: false });',
|
|
2705
2714
|
' return { route, screenshot, summary };',
|
|
@@ -2729,10 +2738,16 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
|
|
|
2729
2738
|
' const artifacts = [];',
|
|
2730
2739
|
' if (routeSummary) artifacts.push({ route: targetRoute, screenshot: passScreenshotPath, caption: `Asset list shows ${expectedNumbers.join(", ")} with canonical yard names and no stale yard labels.` });',
|
|
2731
2740
|
' for (const row of data.rows) {',
|
|
2732
|
-
' const
|
|
2733
|
-
' const
|
|
2734
|
-
'
|
|
2735
|
-
'
|
|
2741
|
+
' const requiredTerms = [row.number || row.id, row.canonicalYardName || row.currentLocationName].filter(Boolean);',
|
|
2742
|
+
' const detail = await gotoAndSummarize(page, `/asset/detail/${row.id}`, `asset-location-detail-${row.number || row.id}.jpg`, requiredTerms);',
|
|
2743
|
+
' const edit = await gotoAndSummarize(page, `/asset/edit/${row.id}`, `asset-location-edit-${row.number || row.id}.jpg`, requiredTerms);',
|
|
2744
|
+
' const detailBody = String(detail.summary.bodyTextSnippet || "");',
|
|
2745
|
+
' const editBody = String(edit.summary.bodyTextSnippet || "");',
|
|
2746
|
+
' const detailHasProof = requiredTerms.every((term) => new RegExp(String(term).replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&"), "i").test(detailBody)) && !isShellOnlySummary(detail.summary);',
|
|
2747
|
+
' const editHasProof = requiredTerms.every((term) => new RegExp(String(term).replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&"), "i").test(editBody)) && !isShellOnlySummary(edit.summary);',
|
|
2748
|
+
' if (detailHasProof) artifacts.push({ route: detail.route, screenshot: detail.screenshot, caption: `Asset ${row.number || row.id} detail shows canonical yard ${row.canonicalYardName || row.currentLocationName}.`, bodyTextSnippet: detail.summary.bodyTextSnippet });',
|
|
2749
|
+
' if (editHasProof) artifacts.push({ route: edit.route, screenshot: edit.screenshot, caption: `Asset ${row.number || row.id} edit screen opens with canonical yard ${row.canonicalYardName || row.currentLocationName} selected/visible.`, bodyTextSnippet: edit.summary.bodyTextSnippet });',
|
|
2750
|
+
' if (!detailHasProof || !editHasProof) mismatchedRows.push({ ...row, proofMissing: `${!detailHasProof ? "detail" : ""}${!detailHasProof && !editHasProof ? "," : ""}${!editHasProof ? "edit" : ""}` });',
|
|
2736
2751
|
' }',
|
|
2737
2752
|
' const pass = !missingNumbers.length && !mismatchedRows.length && !listMissing.length && !staleSeen.length && data.rows.length >= Math.max(expectedNumbers.length, 1);',
|
|
2738
2753
|
' const payload = { status: pass ? "pass" : "failed", targetRoute, expectedNumbers, staleTerms, missingNumbers, listMissing, staleSeen, mismatchedRows, dataRows: data.rows, artifacts, updated_at: new Date().toISOString() };',
|