diff --git a/types/tests/webElement.test-d.ts b/types/tests/webElement.test-d.ts index 6bd10a5e6..c0634a295 100644 --- a/types/tests/webElement.test-d.ts +++ b/types/tests/webElement.test-d.ts @@ -191,7 +191,8 @@ describe('new element() api', function () { expectType>(elem.submit()); expectType>(elem.setProperty('type', 'text')); expectType>(elem.setAttribute('role', 'button')); - expectType>(elem.dragAndDrop({xOffset: 150, yOffset: 500})); + expectType>(elem.dragAndDrop({x: 150, y: 500})); + expectType>(elem.dragAndDrop(elem.webElement)); expectType>(elem.moveTo(100, 100)); expectType>(elem.clickAndHold()); expectType>(elem.doubleClick()); diff --git a/types/web-element.d.ts b/types/web-element.d.ts index 6505b388d..76f7d65b0 100644 --- a/types/web-element.d.ts +++ b/types/web-element.d.ts @@ -360,10 +360,9 @@ export type ScopedElementRect = { readonly height: number; }; -export type DragAndDropDestination = { - readonly xOffset: number; - readonly yOffset: number; -}; +export type DragAndDropDestination = + | {readonly x: number; readonly y: number;} + | WebElement export interface ElementFunction extends Pick<