codeceptjs / codeceptjs/CodeceptJS
[Types] Unable to extend ILocator, and addFilter is missing from Locator
- 主要言語
- JavaScript
- スター
- 4.2k
- フォーク
- 757
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 16
説明
#### What are you trying to achieve?
I would like to extend the `ILocator` type in order to add a custom Locator to it (e.g. {da: string}) for selecting elements with a custom `data-automation` attribute.
I would also like to call `locator.addFillter()` without getting a TS error.
#### What do you get instead?
##### ILocator
I am unable to extend ILocator type as it isn't exported on the types:

##### Locator
I have to extend `Locator` to declare `addFilter`, as this property is missing from the generated types.
``` ts
interface Locator {
addFilter: (
callback: (
providedLocator: Record,
locatorObj: { type: string; value: string },
) => void,
) => void;
}
```
otherwise, I'll get this:

### Details
* CodeceptJS version: 2.6.8
* NodeJS Version: 12
* Operating System: OSX
* playwright: 1.3.0
コントリビューションガイド
評価
この issue はまだ評価されていません。