[V8] Updated props to optional for getText and getLocation commands#12307
[V8] Updated props to optional for getText and getLocation commands#12307christian-bromann merged 7 commits intowebdriverio:v8from
Conversation
|
Thanks for the contribution! Can you raise the same PR for |
Sure |
|
@christian-bromann I have added tests as well can you please take a look again? if all things are good then I'll add this same changes in other PR. |
christian-bromann
left a comment
There was a problem hiding this comment.
Some question, it seems like this bug wasn't validated in the first place as given changes don't actually let the test fail.
| this: WebdriverIO.Element, | ||
| prop?: keyof Location | ||
| ): Promise<Location | number> { | ||
| ): Promise<any> { |
There was a problem hiding this comment.
I don't see the need to make this any, what is the reasoning for this change?
| ): Promise<any> { | |
| ): Promise<Location | number> { |
There was a problem hiding this comment.
if here we use return type as Location | number then the declaration refrence is not working as expected for getLocation() it will ask for an 1 argument in the warning because reference for IDE always point to export function getSize (this: WebdriverIO.Element, prop: keyof RectReturn): Promise<number> declaration.
There was a problem hiding this comment.
I am not sure if this is the right solution then. We shouldn't return any as we loose type information about the return value. I might be wrong here though, do you have any reference documentation that recommends this approach?
There was a problem hiding this comment.
Yup you are correct that is not right, I have updated the code with a different solution
| this: WebdriverIO.Element, | ||
| prop?: keyof RectReturn | ||
| ): Promise<Size | number> { | ||
| ): Promise<any> { |
There was a problem hiding this comment.
Same answer as above
|
Hey jemishgopani 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
Fixes #12173
Types of changes
Checklist
Reviewers: @webdriverio/project-committers