@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) • 586 B
JavaScript
import { sendMouse } from '@web/test-runner-commands';
import { getCenterOfElement } from './symlinked/element-position.js';
async function sendMouseToMiddleOfElement(element, operationType) {
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');
}