mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(qa): wait for Control UI composer readiness (#105309)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user