UNPKG

@augment-vir/test

Version:

A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.

19 lines (18 loc) 600 B
import { getCenterOfElement } from './symlinked/element-position.js'; async function sendMouseToMiddleOfElement(element, operationType) { const { sendMouse } = await import('@web/test-runner-commands'); const center = getCenterOfElement(element); await sendMouse({ position: [ center.x, center.y, ], type: operationType, }); } export async function clickElement(element) { await sendMouseToMiddleOfElement(element, 'click'); } export async function moveToElement(element) { return sendMouseToMiddleOfElement(element, 'move'); }