up
This commit is contained in:
+8
-7
@@ -426,13 +426,14 @@ app.whenReady().then(async () => {
|
||||
async () => (await state()).channels.main.status === 'paused',
|
||||
'plan media paused',
|
||||
)
|
||||
await evaluate(`(() => {
|
||||
const input = document.querySelector('.plan-step-current input[id^="volume-main-"]')
|
||||
input.focus(); input.value = '42'
|
||||
input.dispatchEvent(new InputEvent('input', { bubbles: true, inputType: 'insertText' }))
|
||||
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
|
||||
input.blur()
|
||||
})()`)
|
||||
await evaluate(`document.querySelector('.plan-step-current [id^="volume-main-"] [role="slider"]').focus()`)
|
||||
for (let attempt = 0; attempt < 100; attempt++) {
|
||||
const volume = (await state()).channels.main.volume
|
||||
if (volume === 42) break
|
||||
await evaluate(`document.querySelector('.plan-step-current [id^="volume-main-"] [role="slider"]')
|
||||
.dispatchEvent(new KeyboardEvent('keydown', { key: ${JSON.stringify(volume > 42 ? 'ArrowLeft' : 'ArrowRight')}, bubbles: true }))`)
|
||||
await poll(async () => (await state()).channels.main.volume !== volume, 'volume slider keyboard update')
|
||||
}
|
||||
await poll(async () => (await state()).channels.main.volume === 42, 'plan media volume')
|
||||
assert.equal((await state()).channels.main.desired, 'paused')
|
||||
assert.equal((await state()).channels.music.desired, 'playing')
|
||||
|
||||
Reference in New Issue
Block a user