【发布时间】:2019-03-06 14:56:45
【问题描述】:
从第 4 版开始,材料 ui 开始使用 forwardRef 包装所有组件。在我的 testcafe 测试中,我依靠“testcafe-react-selectors”库根据名称选择组件。所以例如
export namespace TimeSlotListPage {
export const TimeSlotList = ReactSelector('TimeSlotList');
export const TimeSlotListItem: Selector = ReactSelector('ListItem');
}
现在在版本 4 中,文档在 react-dev-tools 中显示为 ForwardRef(List),但使用 ReactSelector('ForwardRef(List)') 进行选择不起作用,ReactSelector('MergeListContext') 也不起作用。有解决办法吗?
【问题讨论】:
标签: reactjs testing material-ui e2e-testing testcafe