tiny-vue/examples/sites/demos/pc/app/numeric/mouse-wheel.spec.ts

14 lines
479 B
TypeScript

import { test, expect } from '@playwright/test'
test('鼠标滚轮事件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('numeric#mouse-wheel')
const numeric = page.getByRole('spinbutton')
const initVal = Number(await numeric.inputValue())
await numeric.click()
await page.mouse.wheel(0, -1000)
const currentVal = Number(await numeric.inputValue())
expect(currentVal).toBeGreaterThanOrEqual(initVal)
})