mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 18:11:20 -08:00
test(chapter): [PKG-CHAPTER-HOVER-01] wait for stable fullscreen geometry
This commit is contained in:
1 parent
492e58a345
commit
d89728c0a6
14 files changed
+1797
-14
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
import assert from 'node:assert/strict'
|
||||
import process from 'node:process'
|
||||
|
||||
export async function hoverProgress(page: Page, percentage: number) {
|
||||
const inner = page.locator('.art-control-progress-inner')
|
||||
if (process.env.ARTPLAYER_CHAPTER_HOVER_BASELINE !== '1')
|
||||
await inner.hover({ trial: true })
|
||||
const box = await inner.boundingBox()
|
||||
assert(box, 'Chapter progress must have a visible box')
|
||||
const x = Math.round(box.x + box.width * percentage)
|
||||
const y = box.y + box.height / 2
|
||||
await page.mouse.move(x, y)
|
||||
return { box, x, y }
|
||||
}
|
||||
Reference in new issue
Block a user