-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix types for dragAndDrop
command in new Elem API.
#4329
Fix types for dragAndDrop
command in new Elem API.
#4329
Conversation
cbfe00b
to
62b0e43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd also be great if you could add some tests for the types modified here.
types/web-element.d.ts
Outdated
}; | ||
} | ||
|{readonly x: number; readonly y: number;} | ||
|WebElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShreySinha02 You're on the right track here but we do not need to include both the coordinates and WebElement here. You can add | WebElement
directly in the type definition of dragAndDrop()
. And perhaps change the above type to DragAndDropDestinationCoordinates
?
@garg3133 made the changes and added the test please look into this |
types/web-element.d.ts
Outdated
export type DragAndDropDestination = | ||
|{readonly x: number; readonly y: number;} | ||
|WebElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor lint fixes (proper spaces), otherwise LGTM!
export type DragAndDropDestination =
| {readonly x: number; readonly y: number;}
| WebElement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks, @ShreySinha02!
dragAndDrop
command in new Elem API.
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.
examples/tests
directory of the project) and running them.ecosia.js
andduckDuckGo.js
are good examples to work with.features/my-new-feature
orissue/123-my-bugfix
);