Closed
Description
Are you requesting a feature or reporting a bug?
feature
What is the current behavior?
We can filter elements by .filter()
method. In complicated cases it looks like:
import { filterFn } from 'my-lib';
const el = Selector('.el').filter(filterFn);
What is the expected behavior?
For plugins it would be useful to create custom filter function like .addCustomMethods
, e.g.
/*my-lib*/
export default Selector(...).addCustomFilter({
customFilter: (nodes, ...args) => {
function filterFn() {
...
}
return filterFn(nodes, ...args);
}
});
/*test*/
import CustomSelector from 'my-lib';
const el = CustomSelector('El').customFilter('...');
Related issues:
DevExpress/testcafe-react-selectors#14
DevExpress/testcafe-react-selectors#51
Specify your
- operating system: any
- testcafe version: 0.18.2
- node.js version: any supported
/cc @DevExpress/testcafe