Skip to content

Commit

Permalink
Fix types for dragAndDrop command in new Elem API. (#4329)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreySinha02 authored Dec 18, 2024
1 parent ba842b7 commit 715a751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion types/tests/webElement.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ describe('new element() api', function () {
expectType<Promise<WebElement>>(elem.submit());
expectType<Promise<WebElement>>(elem.setProperty('type', 'text'));
expectType<Promise<WebElement>>(elem.setAttribute('role', 'button'));
expectType<Promise<WebElement>>(elem.dragAndDrop({xOffset: 150, yOffset: 500}));
expectType<Promise<WebElement>>(elem.dragAndDrop({x: 150, y: 500}));
expectType<Promise<WebElement>>(elem.dragAndDrop(elem.webElement));
expectType<Promise<WebElement>>(elem.moveTo(100, 100));
expectType<Promise<WebElement>>(elem.clickAndHold());
expectType<Promise<WebElement>>(elem.doubleClick());
Expand Down
7 changes: 3 additions & 4 deletions types/web-element.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down

0 comments on commit 715a751

Please sign in to comment.