Files
cnc_wams/wasm-port/tests/browser/ini_panel_launch_smoke.html

760 lines
31 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LinuxCNC INI Launch Smoke</title>
</head>
<body>
<pre id="status">running</pre>
<script type="module">
import {
createControlPageBrowserApiMethods,
createIniPanelLaunchApiManifest,
createIniPanelLauncherLinkViewModel,
createIniPanelShellIntegrationManifest,
createIniPanelShellViewModel,
getIniPanelEntryByHref,
getVisibleIniPanelEntries,
} from "../../runtime/ui/ini-panel/ui-shell.js";
function assertEqual(actual, expected, label) {
if (actual !== expected) {
throw new Error(`${label}: expected ${expected}, got ${actual}`);
}
}
async function loadFrame(src) {
const frame = document.createElement("iframe");
frame.src = src;
document.body.appendChild(frame);
await new Promise((resolve, reject) => {
frame.addEventListener("load", resolve, { once: true });
frame.addEventListener("error", reject, { once: true });
});
return frame.contentDocument;
}
async function loadLaunchFrame() {
return loadFrame("../../runtime/ui/ini-panel/launch.html");
}
try {
const visibleEntries = getVisibleIniPanelEntries();
assertEqual(visibleEntries.length, 3, "launch visible entry length");
const launcherLinks = createIniPanelLauncherLinkViewModel();
assertEqual(launcherLinks.length, 3, "launcher link model length");
assertEqual(launcherLinks[0].entryId, "edit-run", "launcher link entry id");
assertEqual(launcherLinks[0].label, "Open edit and run panel", "launcher link label");
assertEqual(launcherLinks[0].href, "./index.html", "launcher link href");
assertEqual(getIniPanelEntryByHref("./index.html").id, "edit-run", "launch manifest edit entry");
assertEqual(
getIniPanelEntryByHref("./control-page.html").title,
"Open read-only control view",
"launch manifest control entry",
);
assertEqual(
getIniPanelEntryByHref("./workflow-overview.html").title,
"Open shell handoff overview",
"launch manifest workflow entry",
);
assertEqual(
createIniPanelShellViewModel().controlPage.browserApiMethods.join(","),
createControlPageBrowserApiMethods().join(","),
"launch shell control-page browser API methods",
);
assertEqual(
createIniPanelShellViewModel().launchApiManifest.apiName,
"ini-panel-launch",
"launch shell API manifest name",
);
assertEqual(
createIniPanelShellViewModel().launchApiManifest.methods.join(","),
createIniPanelLaunchApiManifest().methods.join(","),
"launch shell API manifest methods",
);
const launchDoc = await loadLaunchFrame();
const launchApi = launchDoc.defaultView.linuxCncIniPanelLaunchApi;
if (
!launchApi?.isSupportedLaunchApiManifest ||
!launchApi?.getLaunchApiSchema ||
!launchApi?.getLaunchApiManifest ||
!launchApi?.getShellIntegrationSchema ||
!launchApi?.getShellIntegrationManifest ||
!launchApi?.getShellIntegrationReadiness ||
!launchApi?.getShellSessionHandoffSummarySchema ||
!launchApi?.getShellSessionHandoffSummary ||
!launchApi?.isSupportedShellSessionHandoffSummary ||
!launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState ||
!launchApi?.getShellSessionHandoffActionPlan ||
!launchApi?.getShellSessionHandoffChecklist ||
!launchApi?.getShellSessionHandoffPackageSchema ||
!launchApi?.getShellSessionHandoffPackage ||
!launchApi?.getShellSessionHandoffPackageReport ||
!launchApi?.getShellSessionHandoffPackageDisplayViewModel ||
!launchApi?.getShellSessionHandoffPackageRenderState ||
!launchApi?.getShellSessionHandoffPackageMountState ||
!launchApi?.getShellSessionHandoffPackageMountDisplayViewModel ||
!launchApi?.getShellSessionHandoffPackageMountRenderState ||
!launchApi?.getShellSessionReadinessWorkflowReport ||
!launchApi?.getShellApiSurfaceInventory ||
!launchApi?.getMachineSessionPersistenceSummary ||
!launchApi?.renderShellSessionHandoffMountState ||
!launchApi?.getWorkflowOverviewContract ||
!launchApi?.getWorkflowOverviewReadiness ||
!launchApi?.mountWorkflowOverviewEmbedding ||
!launchApi?.getWorkflowOverviewEmbeddingReport ||
!launchApi?.getWorkflowOverviewEmbeddingDisplayViewModel ||
!launchApi?.getWorkflowOverviewEmbeddingRenderState ||
!launchApi?.getWorkflowOverviewEmbeddingDomContract ||
!launchApi?.getWorkflowOverviewEmbeddingDomReadiness ||
!launchApi?.renderWorkflowOverviewEmbeddingState ||
!launchApi?.mountWorkflowOverviewEmbeddingState ||
!launchApi?.getWorkflowOverviewEmbeddingMountDisplayViewModel ||
!launchApi?.getWorkflowOverviewEmbeddingMountRenderState ||
!launchApi?.getWorkflowOverviewEmbeddingMountDomContract ||
!launchApi?.getWorkflowOverviewEmbeddingMountDomReadiness ||
!launchApi?.renderWorkflowOverviewEmbeddingMountState ||
!launchApi?.mountWorkflowOverviewEmbeddingMountState ||
!launchApi?.isSupportedShellSessionHandoffPackage ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
) {
throw new Error("launch API namespace did not expose shell helpers");
}
const launchApiSchema = launchApi.getLaunchApiSchema();
assertEqual(
launchApiSchema.manifestVersion,
1,
"launch API schema manifest version",
);
assertEqual(
launchApiSchema.fields.includes("persistenceCapabilities"),
true,
"launch API schema persistence field",
);
const launchApiManifest = launchApi.getLaunchApiManifest();
assertEqual(
launchApi.isSupportedLaunchApiManifest(launchApiManifest),
true,
"launch API supports manifest",
);
assertEqual(
launchApi.isSupportedLaunchApiManifest({ ...launchApiManifest, manifestVersion: 2 }),
false,
"launch API rejects unsupported manifest version",
);
assertEqual(
launchApiManifest.apiName,
"ini-panel-launch",
"launch API manifest name",
);
assertEqual(
launchApiManifest.manifestVersion,
1,
"launch API manifest version",
);
assertEqual(
launchApiManifest.methods.join(","),
createIniPanelLaunchApiManifest().methods.join(","),
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
const shellIntegrationManifest = launchApi.getShellIntegrationManifest();
const shellIntegrationReadiness = launchApi.getShellIntegrationReadiness();
const shellSessionHandoffSummarySchema = launchApi.getShellSessionHandoffSummarySchema();
const shellSessionHandoffSummary = launchApi.getShellSessionHandoffSummary();
const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel();
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const shellSessionHandoffRenderState = launchApi.getShellSessionHandoffRenderState();
const shellSessionHandoffActionPlan = launchApi.getShellSessionHandoffActionPlan();
const shellSessionHandoffChecklist = launchApi.getShellSessionHandoffChecklist();
const shellSessionHandoffPackageSchema = launchApi.getShellSessionHandoffPackageSchema();
const shellSessionHandoffPackage = launchApi.getShellSessionHandoffPackage();
const shellSessionHandoffPackageReport = launchApi.getShellSessionHandoffPackageReport();
const shellSessionHandoffPackageDisplayViewModel = launchApi.getShellSessionHandoffPackageDisplayViewModel();
const shellSessionHandoffPackageRenderState = launchApi.getShellSessionHandoffPackageRenderState();
const shellSessionHandoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
const shellSessionHandoffPackageMountDisplayViewModel = launchApi.getShellSessionHandoffPackageMountDisplayViewModel();
const shellSessionHandoffPackageMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState();
const shellSessionReadinessWorkflowReport = launchApi.getShellSessionReadinessWorkflowReport();
const shellApiSurfaceInventory = launchApi.getShellApiSurfaceInventory();
const launchPersistenceSummary = launchApi.getMachineSessionPersistenceSummary();
const workflowOverviewContract = launchApi.getWorkflowOverviewContract();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
"shell integration schema manifest version",
);
assertEqual(
shellIntegrationManifest.apiName,
"ini-panel-shell-integration",
"shell integration manifest API name",
);
assertEqual(
shellIntegrationManifest.compatibility.launchApiManifest,
true,
"shell integration launch compatibility",
);
assertEqual(
shellIntegrationManifest.compatibility.controlPageApiManifest,
true,
"shell integration control-page compatibility",
);
assertEqual(
shellIntegrationManifest.controlPageApiManifest.apiName,
"ini-panel-control-page",
"shell integration control-page manifest name",
);
assertEqual(
shellIntegrationReadiness.ready,
true,
"shell integration readiness",
);
assertEqual(
shellIntegrationReadiness.counts.persistenceCapabilities,
3,
"shell integration readiness capability count",
);
assertEqual(
shellIntegrationReadiness.missing.join(","),
"",
"shell integration readiness missing checks",
);
assertEqual(
shellSessionHandoffSummary.ready,
true,
"shell session handoff summary readiness",
);
assertEqual(
shellSessionHandoffSummarySchema.summaryVersion,
1,
"shell session handoff summary schema version",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(shellSessionHandoffSummary),
true,
"shell session handoff summary supported",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary({ ...shellSessionHandoffSummary, summaryVersion: 2 }),
false,
"shell session handoff summary rejects version",
);
assertEqual(
shellSessionHandoffCompatibilityReport.compatible,
true,
"shell session handoff compatibility report",
);
assertEqual(
shellSessionHandoffCompatibilityReport.summarySupported,
true,
"shell session handoff summary support report",
);
assertEqual(
shellSessionHandoffCompatibilityReport.missingFields.join(","),
"",
"shell session handoff compatibility missing fields",
);
assertEqual(
shellSessionHandoffDisplayViewModel.statusText,
"Ready",
"shell session handoff display status",
);
assertEqual(
shellSessionHandoffDisplayViewModel.rows.length,
5,
"shell session handoff display rows",
);
assertEqual(
shellSessionHandoffSnapshot.snapshotVersion,
1,
"shell session handoff snapshot version",
);
assertEqual(
shellSessionHandoffSnapshot.ready,
true,
"shell session handoff snapshot readiness",
);
assertEqual(
shellSessionHandoffRenderState.renderStateVersion,
1,
"shell session handoff render-state version",
);
assertEqual(
shellSessionHandoffRenderState.ready,
true,
"shell session handoff render-state readiness",
);
assertEqual(
shellSessionHandoffRenderState.statusLine,
"Ready: No blocking reasons",
"shell session handoff render-state status",
);
assertEqual(
shellSessionHandoffActionPlan.planVersion,
1,
"shell session handoff action-plan version",
);
assertEqual(
shellSessionHandoffActionPlan.ready,
true,
"shell session handoff action-plan readiness",
);
assertEqual(
shellSessionHandoffActionPlan.nextSteps.map(({ id }) => id).join(","),
"open-control-page,read-readonly-status",
"shell session handoff action-plan next steps",
);
assertEqual(
shellSessionHandoffActionPlan.requiredMethods.readStatus,
"readControlPageStatus",
"shell session handoff action-plan read method",
);
assertEqual(
shellSessionHandoffChecklist.checklistVersion,
1,
"shell session handoff checklist version",
);
assertEqual(
shellSessionHandoffChecklist.ready,
true,
"shell session handoff checklist readiness",
);
assertEqual(
shellSessionHandoffChecklist.checks.map(({ status }) => status).join(","),
"pass,pass,pass,pass,pass",
"shell session handoff checklist checks",
);
assertEqual(
shellSessionHandoffChecklist.nextStepIds.join(","),
"open-control-page,read-readonly-status",
"shell session handoff checklist next step ids",
);
assertEqual(
shellSessionHandoffPackage.packageVersion,
1,
"shell session handoff package version",
);
assertEqual(
shellSessionHandoffPackageSchema.packageVersion,
1,
"shell session handoff package schema version",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffPackage(shellSessionHandoffPackage),
true,
"shell session handoff package supported",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffPackage({ ...shellSessionHandoffPackage, packageVersion: 2 }),
false,
"shell session handoff package rejects version",
);
assertEqual(
shellSessionHandoffPackageReport.ready,
true,
"shell session handoff package report readiness",
);
assertEqual(
shellSessionHandoffPackageReport.rows.length,
6,
"shell session handoff package report rows",
);
assertEqual(
shellSessionHandoffPackageReport.missingPackageFields.join(","),
"",
"shell session handoff package report missing fields",
);
assertEqual(
shellSessionHandoffPackageDisplayViewModel.statusText,
"Ready",
"shell session handoff package display status",
);
assertEqual(
shellSessionHandoffPackageDisplayViewModel.rows.length,
shellSessionHandoffPackageReport.rows.length,
"shell session handoff package display rows",
);
assertEqual(
shellSessionHandoffPackageRenderState.renderStateVersion,
1,
"shell session handoff package render-state version",
);
assertEqual(
shellSessionHandoffPackageRenderState.ready,
true,
"shell session handoff package render-state readiness",
);
assertEqual(
shellSessionHandoffPackageRenderState.rows.length,
shellSessionHandoffPackageDisplayViewModel.rows.length,
"shell session handoff package render-state rows",
);
assertEqual(
shellSessionHandoffPackageMountState.mountStateVersion,
1,
"shell session handoff package mount-state version",
);
assertEqual(
shellSessionHandoffPackageMountState.packageReady,
true,
"shell session handoff package mount-state package readiness",
);
assertEqual(
shellSessionHandoffPackageMountState.targetPage.href,
"./control-page.html",
"shell session handoff package mount-state target",
);
assertEqual(
shellSessionHandoffPackageMountState.requiredMethods.readStatus,
"readControlPageStatus",
"shell session handoff package mount-state read method",
);
assertEqual(
shellSessionHandoffPackageMountState.sessionLoadState.phase,
"waiting-panel",
"shell session handoff package mount-state default session",
);
assertEqual(
shellSessionHandoffPackageMountDisplayViewModel.detailText,
"session-load-state",
"shell session handoff package mount display detail",
);
assertEqual(
shellSessionHandoffPackageMountRenderState.statusLine,
"Blocked: session-load-state",
"shell session handoff package mount render-state status",
);
assertEqual(
shellSessionReadinessWorkflowReport.apiName,
"ini-panel-shell-session-readiness-workflow-report",
"shell session readiness workflow report API",
);
assertEqual(
shellSessionReadinessWorkflowReport.rows.length,
3,
"shell session readiness workflow report rows",
);
assertEqual(
shellApiSurfaceInventory.apiName,
"ini-panel-shell-api-surface-inventory",
"shell API surface inventory API",
);
assertEqual(
shellApiSurfaceInventory.counts.sessionReadinessRows,
3,
"shell API surface inventory session readiness rows",
);
assertEqual(
shellApiSurfaceInventory.counts.persistenceSummaryRows,
7,
"shell API surface inventory persistence summary rows",
);
assertEqual(
launchPersistenceSummary.apiName,
"machine-session-persistence-summary",
"launch API persistence summary API",
);
assertEqual(
launchPersistenceSummary.rows.length,
7,
"launch API persistence summary rows",
);
assertEqual(
workflowOverviewContract.pageHref,
"./workflow-overview.html",
"workflow overview contract page",
);
assertEqual(
workflowOverviewContract.apiName,
"linuxCncIniPanelWorkflowOverviewApi",
"workflow overview contract API name",
);
assertEqual(
workflowOverviewContract.methodNames.includes("mountWorkflowOverview"),
true,
"workflow overview contract mount method",
);
assertEqual(
shellSessionHandoffPackage.ready,
true,
"shell session handoff package readiness",
);
assertEqual(
shellSessionHandoffPackage.manifests.launchMethods.includes("getShellSessionHandoffPackage"),
true,
"shell session handoff package launch methods",
);
assertEqual(
shellSessionHandoffPackage.manifests.controlPageMethods.includes("readControlPageStatus"),
true,
"shell session handoff package control methods",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.readiness),
JSON.stringify(shellIntegrationReadiness),
"shell session handoff snapshot readiness object",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.summary),
JSON.stringify(shellSessionHandoffSummary),
"shell session handoff snapshot summary object",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.displayViewModel),
JSON.stringify(shellSessionHandoffDisplayViewModel),
"shell session handoff snapshot display object",
);
assertEqual(
JSON.stringify(shellSessionHandoffRenderState.rows),
JSON.stringify(shellSessionHandoffDisplayViewModel.rows),
"shell session handoff render-state rows",
);
assertEqual(
JSON.stringify(shellSessionHandoffActionPlan.displayRows),
JSON.stringify(shellSessionHandoffRenderState.rows),
"shell session handoff action-plan rows",
);
assertEqual(
JSON.stringify(shellSessionHandoffChecklist.displayRows),
JSON.stringify(shellSessionHandoffRenderState.rows),
"shell session handoff checklist rows",
);
assertEqual(
JSON.stringify(shellSessionHandoffPackage.checklist),
JSON.stringify(shellSessionHandoffChecklist),
"shell session handoff package checklist",
);
assertEqual(
launchDoc.querySelector("[data-handoff-status]").textContent,
"Ready: No blocking reasons",
"shell session handoff DOM status",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffPhase,
"ready",
"shell session handoff DOM phase",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffReady,
"true",
"shell session handoff DOM ready",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffScope,
"package",
"shell session handoff DOM scope",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="package-supported"]').textContent,
"supported",
"shell session handoff DOM package support",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="package-ready"]').textContent,
"ready",
"shell session handoff DOM package readiness",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="missing-package-fields"]').textContent,
"none",
"shell session handoff DOM missing package fields",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="blocking-reasons"]').textContent,
"none",
"shell session handoff DOM blocking reasons",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount-status]").textContent,
"Blocked: session-load-state",
"shell session handoff mount DOM status",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffPhase,
"blocked",
"shell session handoff mount DOM phase",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffReady,
"false",
"shell session handoff mount DOM ready",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffScope,
"mount",
"shell session handoff mount DOM scope",
);
assertEqual(
launchDoc.querySelector('[data-handoff-mount-value="session-load-state"]').textContent,
"waiting-panel",
"shell session handoff mount DOM session state",
);
assertEqual(
launchDoc.querySelector('[data-handoff-mount-value="session-load-state"]').dataset.handoffMountStatus,
"blocked",
"shell session handoff mount DOM session status",
);
assertEqual(
shellSessionHandoffSummary.targetPage.href,
"./control-page.html",
"shell session handoff summary target",
);
assertEqual(
shellSessionHandoffSummary.readonlyStatusFields.includes("session"),
true,
"shell session handoff summary readonly fields",
);
assertEqual(
shellSessionHandoffSummary.persistenceCapabilities.length,
3,
"shell session handoff summary persistence capabilities",
);
assertEqual(
JSON.stringify(shellIntegrationManifest),
JSON.stringify(createIniPanelShellIntegrationManifest()),
"shell integration manifest",
);
assertEqual(
launchApiManifest.visibleEntries.length,
3,
"launch API manifest visible entry count",
);
assertEqual(
launchApiManifest.targetPages[1].href,
"./control-page.html",
"launch API manifest control target",
);
assertEqual(
launchApiManifest.targetPages[2].href,
"./workflow-overview.html",
"launch API manifest workflow target",
);
assertEqual(
launchApiManifest.persistenceCapabilities.length,
3,
"launch API manifest persistence capability count",
);
assertEqual(
launchApiManifest.persistenceCapabilities.map((capability) => capability.id).join(","),
"machine-files,session-snapshot,readonly-status",
"launch API manifest persistence capability ids",
);
assertEqual(
launchApiManifest.persistenceCapabilities[2].scope,
"control-page",
"launch API manifest readonly status scope",
);
assertEqual(
launchDoc.querySelector('a[href="./index.html"]').textContent,
"Open edit and run panel",
"launch panel edit link",
);
assertEqual(
launchDoc.querySelector('a[href="./control-page.html"]').textContent,
"Open read-only control view",
"launch panel control link",
);
assertEqual(
launchDoc.querySelector('a[href="./workflow-overview.html"]').textContent,
"Open shell handoff overview",
"launch panel workflow link",
);
assertEqual(
launchApi.getLauncherLinks().length,
3,
"launch API launcher link count",
);
assertEqual(
launchApi.getControlPageApiMethods().join(","),
createControlPageBrowserApiMethods().join(","),
"launch API control-page browser methods",
);
const workflowOverviewDoc = await loadFrame("../../runtime/ui/ini-panel/workflow-overview.html");
const workflowOverviewApi = workflowOverviewDoc.defaultView.linuxCncIniPanelWorkflowOverviewApi;
if (
!workflowOverviewApi?.getWorkflowOverviewRenderState ||
!workflowOverviewApi?.getWorkflowOverviewContract ||
!workflowOverviewApi?.getWorkflowOverviewReadinessFromApi ||
!workflowOverviewApi?.mountWorkflowOverviewEmbedding ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingReport ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingDisplayViewModel ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingRenderState ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingDomContract ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingDomReadiness ||
!workflowOverviewApi?.renderWorkflowOverviewEmbeddingState ||
!workflowOverviewApi?.mountWorkflowOverviewEmbeddingState ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingMountDisplayViewModel ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingMountRenderState ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingMountDomContract ||
!workflowOverviewApi?.getWorkflowOverviewEmbeddingMountDomReadiness ||
!workflowOverviewApi?.renderWorkflowOverviewEmbeddingMountState ||
!workflowOverviewApi?.mountWorkflowOverviewEmbeddingMountState
) {
throw new Error("workflow overview API namespace did not expose shell helpers");
}
const workflowOverviewReadiness = launchApi.getWorkflowOverviewReadiness({
overviewApi: workflowOverviewApi,
});
const workflowOverviewEmbedding = launchApi.mountWorkflowOverviewEmbedding({
overviewApi: workflowOverviewApi,
});
const workflowOverviewEmbeddingReport = launchApi.getWorkflowOverviewEmbeddingReport(
workflowOverviewEmbedding,
);
const workflowOverviewEmbeddingDisplay = launchApi.getWorkflowOverviewEmbeddingDisplayViewModel(
workflowOverviewEmbeddingReport,
);
const workflowOverviewEmbeddingRenderState = launchApi.getWorkflowOverviewEmbeddingRenderState(
workflowOverviewEmbeddingDisplay,
);
const workflowOverviewEmbeddingDomContract = launchApi.getWorkflowOverviewEmbeddingDomContract();
const workflowOverviewEmbeddingDomReadiness = launchApi.getWorkflowOverviewEmbeddingDomReadiness({
documentRef: workflowOverviewDoc,
contract: workflowOverviewEmbeddingDomContract,
});
assertEqual(workflowOverviewApi.getWorkflowOverviewContract().pageHref, "./workflow-overview.html", "workflow overview page contract");
assertEqual(workflowOverviewReadiness.ready, true, "workflow overview readiness");
assertEqual(workflowOverviewReadiness.missing.join(","), "", "workflow overview readiness missing");
assertEqual(workflowOverviewApi.getWorkflowOverviewReadinessFromApi().ready, true, "workflow overview self readiness");
assertEqual(workflowOverviewEmbedding.apiName, "ini-panel-shell-workflow-overview-embedding", "workflow overview embedding API name");
assertEqual(workflowOverviewEmbedding.pageHref, "./workflow-overview.html", "workflow overview embedding page");
assertEqual(workflowOverviewEmbedding.ready, false, "workflow overview embedding default readiness");
assertEqual(workflowOverviewEmbedding.renderState.dataset.handoffScope, "workflow", "workflow overview embedding scope");
assertEqual(workflowOverviewEmbedding.mountResult.renderResult.rowCount, 8, "workflow overview embedding rows");
assertEqual(workflowOverviewEmbedding.error, null, "workflow overview embedding error");
assertEqual(workflowOverviewEmbeddingReport.apiName, "ini-panel-shell-workflow-overview-embedding-report", "workflow overview embedding report API name");
assertEqual(workflowOverviewEmbeddingReport.ready, false, "workflow overview embedding report readiness");
assertEqual(workflowOverviewEmbeddingReport.missingMethods.join(","), "", "workflow overview embedding report missing methods");
assertEqual(workflowOverviewEmbeddingReport.renderRowCount, 8, "workflow overview embedding report row count");
assertEqual(workflowOverviewEmbeddingReport.rows.length, 6, "workflow overview embedding report rows");
assertEqual(workflowOverviewEmbeddingDisplay.title, "Workflow overview embedding", "workflow overview embedding display title");
assertEqual(workflowOverviewEmbeddingDisplay.statusText, "Blocked", "workflow overview embedding display status");
assertEqual(workflowOverviewEmbeddingDisplay.rows.length, 6, "workflow overview embedding display rows");
assertEqual(workflowOverviewEmbeddingRenderState.statusLine, "Blocked: embedding:blocked, mount:blocked", "workflow overview embedding render-state status");
assertEqual(workflowOverviewEmbeddingRenderState.dataset.handoffScope, "workflow-overview-embedding", "workflow overview embedding render-state scope");
assertEqual(workflowOverviewEmbeddingDomContract.selectors.mount, "[data-workflow-overview-embedding]", "workflow overview embedding DOM contract mount");
assertEqual(workflowOverviewEmbeddingDomContract.rowDatasetKeys.detail[0], "workflowOverviewEmbeddingValue", "workflow overview embedding DOM contract row key");
assertEqual(workflowOverviewEmbeddingDomReadiness.ready, false, "workflow overview embedding DOM readiness");
assertEqual(workflowOverviewEmbeddingDomReadiness.missing.join(","), "mount,status,rows", "workflow overview embedding DOM readiness missing");
assertEqual(
workflowOverviewApi.getWorkflowOverviewEmbeddingDomReadiness().ready,
false,
"workflow overview self embedding DOM readiness",
);
status.textContent = "browser_ini_launch_smoke=ok";
console.log("browser_ini_launch_smoke=ok");
} catch (error) {
status.textContent = `browser_ini_launch_smoke=failed: ${error.message}`;
console.error(error);
throw error;
}
</script>
</body>
</html>