-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[🐛 Bug]: wrong type for getValue #15097
Copy link
Copy link
Closed
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.24.0
Node.js Version
22.21.1
Mode
Standalone Mode
Which capabilities are you using?
What happened?
The type returned by element.getValue function is described as string but the type defined in getValue.d.ts file is unknown:
* @alias element.getValue
* @return {String} requested element(s) value
* @uses protocol/elements, protocol/elementIdProperty
*
*/
export declare function getValue(this: WebdriverIO.Element): Promise<unknown>;
This forces me to always use casting:
const range = await someElement.getValue() as string;
const startDate = range.substring(0, 10);
instead of:
const range = await someElement.getValue();
const startDate = range.substring(0, 10);
it was properly defined like this:
export declare function getValue(this: WebdriverIO.Element): Promise<string>;
in 9.20.1.
What is your expected behavior?
No response
How to reproduce the bug.
install the latest webdriverio and use getValue function
Relevant log output
eslint detects it as:
error Unsafe call of a type that could not be resolved @typescript-eslint/no-unsafe-callCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable