up
This commit is contained in:
+9
-15
@@ -214,6 +214,7 @@ app.whenReady().then(async () => {
|
||||
'control UI',
|
||||
)
|
||||
if (manual) {
|
||||
await evaluate(`window.screenBridge.selectPackage(${JSON.stringify(offlinePackage.key)})`)
|
||||
console.log(
|
||||
'SCREEN004_ACCEPTANCE_READY',
|
||||
JSON.stringify({ userData: app.getPath('userData'), electron: process.versions.electron }),
|
||||
@@ -273,16 +274,8 @@ app.whenReady().then(async () => {
|
||||
)
|
||||
assert.deepEqual(range, { status: 206, size: 100 })
|
||||
await command({ action: 'pause', channel: 'main' })
|
||||
await evaluate("document.querySelector('.n-base-selection').click()")
|
||||
await poll(
|
||||
() =>
|
||||
evaluate(`(() => {
|
||||
const option = Array.from(document.querySelectorAll('.n-base-select-option')).find(el => el.textContent.includes('Offline smoke'))
|
||||
if (!option) return false
|
||||
option.click(); return true
|
||||
})()`),
|
||||
'UI package choice',
|
||||
)
|
||||
assert.equal(await evaluate('document.body.textContent.includes("Материалы показа")'), false)
|
||||
await evaluate(`window.screenBridge.selectPackage(${JSON.stringify(offlinePackage.key)})`)
|
||||
await poll(async () => {
|
||||
const s = await state()
|
||||
return (
|
||||
@@ -424,12 +417,13 @@ app.whenReady().then(async () => {
|
||||
if (index === 7)
|
||||
assert.ok(await inspect('document.body.textContent.includes("Кириллица: Ёжик и улика №7")'))
|
||||
}
|
||||
const publishedText = (await state()).scene.text
|
||||
await evaluate(
|
||||
`(() => { const input = document.querySelector('#scene-text'); input.value = 'Черновик ещё не показан'; input.dispatchEvent(new Event('input', {bubbles:true})) })()`,
|
||||
assert.equal(
|
||||
await evaluate(
|
||||
`!!document.querySelector(${JSON.stringify('#scene-text, #timer-label, #timer-seconds, [aria-label="Режим показа"]')})`,
|
||||
),
|
||||
false,
|
||||
)
|
||||
await delay(100)
|
||||
assert.equal((await state()).scene.text, publishedText)
|
||||
assert.equal(await evaluate('document.body.textContent.includes("Текст и таймер")'), false)
|
||||
const safeText = 'Привет\n<script>window.__unsafe = true</script>'
|
||||
await command({ action: 'text', text: safeText })
|
||||
await sceneReady(8)
|
||||
|
||||
Reference in New Issue
Block a user