This commit is contained in:
2026-10-17 22:11:06 +07:00
parent 35e579701a
commit 688d900cdc
13 changed files with 192 additions and 15 deletions
+43
View File
@@ -106,17 +106,60 @@ module.exports = async function onlineSmoke({
async () => !(await evaluate('window.screenBridge.onlineState()')).busy,
'login complete',
)
await poll(
() =>
evaluate(
`Array.from(document.querySelectorAll('.n-base-selection')).some(e => e.textContent.includes('Выберите игру для подготовки'))`,
),
'server game selector',
)
await evaluate(
`Array.from(document.querySelectorAll('.n-base-selection')).find(e => e.textContent.includes('Выберите игру для подготовки')).click()`,
)
await poll(
() =>
evaluate(
`Array.from(document.querySelectorAll('.n-base-select-option')).some(e => e.textContent.includes('HTTP smoke · Завершена'))`,
),
'translated game status',
)
await evaluate(
`Array.from(document.querySelectorAll('.n-base-select-option')).find(e => e.textContent.includes('HTTP smoke · Завершена')).click()`,
)
const selectedBeforeDownload = (await state()).catalog.name
await poll(
() =>
evaluate(
`document.querySelector('[data-testid="control-game"]')?.textContent.includes(${JSON.stringify(selectedBeforeDownload)})`,
),
'control target stays on local package despite server game selection',
)
assert.notEqual(selectedBeforeDownload, 'HTTP smoke')
await act({ action: 'download', gameId: 6 })
const packages = await evaluate('window.screenBridge.packages()')
const pkg = packages.find((p) => p.name === 'HTTP smoke')
assert.ok(pkg)
await evaluate(`window.screenBridge.selectPackage(${JSON.stringify(pkg.key)})`)
await poll(
() =>
evaluate(
`document.querySelector('[data-testid="control-game"]')?.textContent.includes('HTTP smoke')`,
),
'control target follows selected local package',
)
await act({ action: 'connect' })
await evaluate(`window.screenBridge.show(${displayId})`)
await poll(
async () => (await evaluate('window.screenBridge.onlineState()')).connection === 'connected',
'HTTP baseline',
)
await poll(
() =>
evaluate(
`document.querySelector('[data-testid="sound-assignment"]')?.textContent.includes('Экран назначен для звука')`,
),
'server sound assignment shown in UI',
)
assert.equal((await state()).channels.main.desired, 'stopped')
version++
await poll(