fix(qa): wait for Control UI composer readiness (#105309)

This commit is contained in:
Vincent Koc
2026-07-12 13:05:32 +02:00
committed by GitHub
parent 04e8aeb784
commit 6f820f9e6c
@@ -85,37 +85,36 @@ flow:
expr: liveTurnTimeoutMs(env, 45000)
- try:
actions:
- call: waitForCondition
saveAs: uiReadySnapshot
args:
- lambda:
async: true
expr: "await (async () => { const snapshot = await webSnapshot({ pageId: uiPageId, maxChars: 12000, timeoutMs: liveTurnTimeoutMs(env, 30000) }); const text = normalizeLowercaseStringOrEmpty(snapshot.text); return text.includes('ready to chat') ? snapshot : undefined; })()"
- expr: liveTurnTimeoutMs(env, 45000)
- 500
catch:
- call: webSnapshot
saveAs: uiReadyFailureSnapshot
- call: webWait
args:
- pageId:
ref: uiPageId
maxChars: 12000
selector: .agent-chat__composer-combobox textarea
timeoutMs:
expr: liveTurnTimeoutMs(env, 45000)
- call: webEvaluate
saveAs: uiReadyState
args:
- pageId:
ref: uiPageId
expression: "(() => { const fallback = document.getElementById('openclaw-mount-fallback'); return { appDefined: Boolean(customElements.get('openclaw-app')), shellPresent: Boolean(document.querySelector('openclaw-app-shell')), composerPresent: Boolean(document.querySelector('.agent-chat__composer-combobox textarea')), fallbackHidden: fallback?.hidden === true }; })()"
timeoutMs:
expr: liveTurnTimeoutMs(env, 15000)
catch:
- call: webEvaluate
saveAs: uiReadyFailureState
args:
- pageId:
ref: uiPageId
expression: "(() => { const app = document.querySelector('openclaw-app'); const resources = performance.getEntriesByType('resource').map((entry) => ({ name: entry.name, type: entry.initiatorType, duration: Math.round(entry.duration), transferSize: entry.transferSize, decodedBodySize: entry.decodedBodySize })); return { url: location.href, readyState: document.readyState, appDefined: Boolean(customElements.get('openclaw-app')), appState: app ? { sessionKey: app.sessionKey, settingsSessionKey: app.settings?.sessionKey, lastActiveSessionKey: app.settings?.lastActiveSessionKey, chatMessages: Array.isArray(app.chatMessages) ? app.chatMessages.length : null, chatLoading: app.chatLoading, lastError: app.lastError, connected: app.connected, tab: app.tab } : null, scripts: Array.from(document.scripts).map((script) => script.src || script.textContent?.slice(0, 80)), links: Array.from(document.querySelectorAll('link')).map((link) => link.href), resources, bodyHtml: document.body.innerHTML.slice(0, 400) }; })()"
expression: "(() => { const fallback = document.getElementById('openclaw-mount-fallback'); return { appDefined: Boolean(customElements.get('openclaw-app')), shellPresent: Boolean(document.querySelector('openclaw-app-shell')), composerPresent: Boolean(document.querySelector('.agent-chat__composer-combobox textarea')), fallbackHidden: fallback?.hidden === true }; })()"
timeoutMs:
expr: liveTurnTimeoutMs(env, 15000)
- throw:
expr: "`control ui did not become ready. state=${JSON.stringify(uiReadyFailureState)} diagnostics=${JSON.stringify(uiReadyFailureSnapshot.diagnostics ?? [])} snapshot: ${uiReadyFailureSnapshot.text}`"
expr: "`control ui composer did not become ready. state=${JSON.stringify(uiReadyFailureState)}`"
- assert:
expr: "Boolean(uiPageId)"
message: control ui page was not available
detailsExpr: "uiReadySnapshot.text"
detailsExpr: "JSON.stringify(uiReadyState)"
- name: text injected through qa-channel gets a correct transport reply
actions:
- set: firstInboundStartIndex