e2ed
Version:
E2E testing framework over Playwright
21 lines (20 loc) • 875 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.dragTo = void 0;
const step_1 = require("../step");
const waitFor_1 = require("./waitFor");
/**
* Drags the source element towards the target element and drops it.
*/
const dragTo = (sourceSelector, targetSelector, { stabilizationInterval, ...options } = {}) => (0, step_1.step)('Drag source element onto target element', async () => {
await sourceSelector
.getPlaywrightLocator()
.dragTo(targetSelector.getPlaywrightLocator(), options);
if (stabilizationInterval !== undefined && stabilizationInterval > 0) {
await (0, waitFor_1.waitForInterfaceStabilization)(stabilizationInterval);
}
}, {
payload: { sourceSelector, stabilizationInterval, ...options, targetSelector },
type: 5 /* LogEventType.InternalAction */,
});
exports.dragTo = dragTo;