test: wait for workspace import controls to become ready
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
This commit is contained in:
@@ -79,3 +79,10 @@ App 旧测试仍假定回顾表单默认展开,改为点击“新回顾”后
|
||||
覆盖层堆栈通过仅编译测试 driver(不运行应用或生产构建)定位到窄转宽后的
|
||||
侧栏按钮,先前 Escape 等待已通过;补齐宽高与 CSS 过渡结束后再原生点击。
|
||||
保留 hit-test、侧栏 inert 和后续归档/弹层操作断言,等待下一轮 CI 验证。
|
||||
|
||||
`29af4090` 的 CI `37212673749`:上轮两项通过,6039 通过、56 跳过,
|
||||
仅工作区导入 Electron 探针失败(Renderer 脚本执行异常)。
|
||||
探针取消选择后按旧名称查询按钮并直接读 disabled,导入中的临时名称会使
|
||||
查询为空;改为等待匹配按钮存在且可用,点击也使用同一就绪条件,并在脚本
|
||||
异常中保留执行表达式和原始 cause。字节核对、同名保护、取消和旧图片保留
|
||||
断言均保留;此为探针时序修正,不宣称修复产品导入故障。
|
||||
|
||||
@@ -37,13 +37,17 @@ app.whenReady().then(async () => {
|
||||
let picks = 0
|
||||
// Only the native chooser is deterministic; App, preload, IPC and filesystem are production.
|
||||
dialog.showOpenDialog = (async () => { picks++; return { canceled: picks === 3, filePaths: picks === 3 ? [] : [join(source, 'import.bin')] } }) as typeof dialog.showOpenDialog
|
||||
const run = <T = unknown>(code: string): Promise<T> => win.webContents.executeJavaScript(code, true)
|
||||
const run = async <T = unknown>(code: string): Promise<T> => {
|
||||
try { return await win.webContents.executeJavaScript(code, true) }
|
||||
catch (error) { throw new Error(`Workspace import probe failed: ${code}`, { cause: error }) }
|
||||
}
|
||||
const wait = async (code: string): Promise<void> => {
|
||||
for (let i = 0; i < 300; i++) { if (await run(code)) return; await new Promise(resolve => setTimeout(resolve, 50)) }
|
||||
throw new Error(`Timed out: ${code}`)
|
||||
}
|
||||
const button = (label: string): string => `[...document.querySelectorAll('button')].find(e=>(e.getAttribute('aria-label')||e.textContent.trim())===${JSON.stringify(label)}&&e.getClientRects().length)`
|
||||
const click = async (label: string): Promise<void> => { await wait(`Boolean(${button(label)})`); await run(`${button(label)}.click()`) }
|
||||
const ready = (label: string): string => `(() => { const target = ${button(label)}; return Boolean(target && !target.disabled) })()`
|
||||
const click = async (label: string): Promise<void> => { await wait(ready(label)); await run(`${button(label)}.click()`) }
|
||||
try {
|
||||
await win.loadURL(process.env.GB_IMPORT_URL!)
|
||||
await wait('Boolean(document.querySelector(".message-generated-image img"))')
|
||||
@@ -64,7 +68,7 @@ app.whenReady().then(async () => {
|
||||
await wait('document.body.innerText.includes("EEXIST")')
|
||||
assert.deepEqual(await readFile(join(project.rootPath, 'selected/import.bin')), bytes)
|
||||
await click('Import files')
|
||||
await wait(`!${button('Import files')}.disabled`)
|
||||
await wait(ready('Import files'))
|
||||
await win.reload()
|
||||
await wait('Boolean(document.querySelector(".message-generated-image img")) && document.querySelector(".message-generated-image img").naturalWidth===1')
|
||||
await writeFile(join(directory, 'result.json'), JSON.stringify({ passed: true, picks, bytes: bytes.length, imageAfterReload: true, artifactCount: database.listArtifacts().length, modelCalls: 0 }))
|
||||
|
||||
Reference in New Issue
Block a user