up
This commit is contained in:
+3
-15
@@ -407,12 +407,12 @@ app.whenReady().then(async () => {
|
||||
)
|
||||
if (index === 0)
|
||||
assert.equal(await inspect('document.querySelector("img.cover").naturalWidth'), 320)
|
||||
else assert.equal(await inspect('document.querySelector("img.background").naturalWidth'), 320)
|
||||
assert.equal(await inspect('document.querySelector("img.background").naturalWidth'), 320)
|
||||
if (index === 1 || index === 3) {
|
||||
const clickMedia = (label) =>
|
||||
evaluate(`(() => {
|
||||
const row = document.querySelector('[data-step-index="${index}"]')
|
||||
const button = Array.from(row.querySelectorAll('button')).find(b => b.textContent.trim() === ${JSON.stringify(label)})
|
||||
const button = Array.from(row.querySelectorAll('button')).find(b => (b.getAttribute('aria-label') ?? b.textContent.trim()) === ${JSON.stringify(label)})
|
||||
if (!button || button.disabled) throw new Error('Main control unavailable')
|
||||
button.click()
|
||||
})()`)
|
||||
@@ -427,19 +427,7 @@ app.whenReady().then(async () => {
|
||||
'plan media paused',
|
||||
)
|
||||
await evaluate(`(() => {
|
||||
const input = document.querySelector('#position-main')
|
||||
input.focus(); input.value = '1'
|
||||
input.dispatchEvent(new InputEvent('input', { bubbles: true, inputType: 'insertText' }))
|
||||
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
|
||||
input.blur()
|
||||
})()`)
|
||||
await clickMedia('Перемотать')
|
||||
await poll(
|
||||
async () => Math.abs((await state()).channels.main.position - 1) < 0.1,
|
||||
'plan media seek',
|
||||
)
|
||||
await evaluate(`(() => {
|
||||
const input = document.querySelector('#volume-main')
|
||||
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 }))
|
||||
|
||||
Reference in New Issue
Block a user