-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Feature] Define Page.click
options typing
#5821
Comments
This is something we considered, but never managed to commit to. It becomes a part of our semver api and we'd like to keep it minimal. Could you define them locally, next to your POM instead? Typescript will tolerate if objects match by shape. |
That's what I am doing at the moment, so I do have a workaround, thanks! I am curious on why you would prefer to keep the typing of an option parameter outside of the library, could you explain a bit more the reasoning behind it? |
If we expose MouseClickOptions, we would want to use it in Frame.click, Page.click, ElementHandle.click, maybe Mouse.down. But should these diverge for some reason (for example Page.click gains crossFrame option to support cross-frame), we would need to do MouseClick & PageClickSupplement. That way we commit to more maintenance work. Mouse click is conservative enough to commit to it, but some other options are not, so we can't commit to maintaining 100 additional types across versions. |
Thanks @pavelfeldman, I will close this issue in that case 🙂 |
Hi everyone,
Thanks for the fantastic library. Loving it.
I am working with the Page Object Model paradigm and I am creating a method to handle different combinations of mouse clicks. My method should accept an identifier (a string that will be used to identify what we are going to click) and an option object to specify what kind of click it will be (single? double? with CTRL? with SHIFT?).
I noticed that
Page.click
second parameter (options) is not typed as an interface that can be wrapped, as inPartial<MouseClickOptions>
. Is there interest in adding similar types?I am happy to create a PR in case.
Cheers
The text was updated successfully, but these errors were encountered: