mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41: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
@@ -1,4 +1,5 @@
|
||||
import { devices } from '@playwright/test'
|
||||
import { hoverProgress } from './chapter-hover.ts'
|
||||
import { expect, test } from './fixtures.js'
|
||||
|
||||
async function openChapter(page, core, chapter) {
|
||||
@@ -37,10 +38,7 @@ async function openChapter(page, core, chapter) {
|
||||
}
|
||||
|
||||
async function hoverChapter(page, percentage, text) {
|
||||
const inner = page.locator('.art-control-progress-inner')
|
||||
const box = await inner.boundingBox()
|
||||
const x = Math.round(box.x + box.width * percentage)
|
||||
await page.mouse.move(x, box.y + box.height / 2)
|
||||
const { box, x } = await hoverProgress(page, percentage)
|
||||
await expect(page.locator('.art-chapter-title')).toHaveText(text)
|
||||
await expect(page.locator('.art-chapter-title')).toHaveCSS('opacity', '1')
|
||||
await expect(page.locator('.art-control-thumbnails')).toBeVisible()
|
||||
|
||||
Reference in new issue
Block a user