Protractor Inheritance from ElementFinder class #41
Answered
by
christian-bromann
NavyMint
asked this question in
Migration Issue
-
Hello guys. We are in a process of migration to Wdio. And stuck on a wrappers classes inherited from protractor ElementFinder. Is there a way to implement same way wrappers in wdio? P.S: I've tried to inherit from Webdriver.Element but no luck, what is the best way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
christian-bromann
Jul 21, 2021
Replies: 1 comment 3 replies
-
You can use declare global {
namespace WebdriverIO {
interface Element {
elementCustomCommand: (arg: unknown) => number
}
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
christian-bromann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
addCommand
to add custom commands to the WebdriverIO element object. See more details on that in the docs. Then you can extend the TypeScript definition by doing: