Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 我们可以在TestCafe中组合css选择器和react选择器吗?_Reactjs_Css Selectors_Automated Tests_E2e Testing_Testcafe - Fatal编程技术网

Reactjs 我们可以在TestCafe中组合css选择器和react选择器吗?

Reactjs 我们可以在TestCafe中组合css选择器和react选择器吗?,reactjs,css-selectors,automated-tests,e2e-testing,testcafe,Reactjs,Css Selectors,Automated Tests,E2e Testing,Testcafe,我目前在基于react的应用程序中工作,我想单击react选择器和CSS选择器的组合元素 const app_ui = ReactSelector("AppUi") const tmp = await app_ui.getReact(); const app_name = tmp.props.app.name const tiles = app_name.Selector('.qa-card'); await t.hover(tiles).click(Selector('button').wit

我目前在基于react的应用程序中工作,我想单击react选择器和CSS选择器的组合元素

const app_ui = ReactSelector("AppUi")
const tmp = await app_ui.getReact();
const app_name = tmp.props.app.name
const tiles = app_name.Selector('.qa-card');
await t.hover(tiles).click(Selector('button').withText('Launch'))

类型错误:app_name.Selector不是一个函数

您可以使用
ReactSelector
Selector
来指定测试中的元素 首先导入它们,然后在测试中使用,例如:

从“testcafe react selectors”导入{react Selector};
从“testcafe”导入{Selector};
固定装置`
.第页`http://url`;
测试('test',异步t=>{
//您可以与app_ui以及选择器指定的元素交互
常量app_ui=ReactSelector(“AppUi”);
const tiles=选择器(“.qa卡”);
等待
.悬停(瓷砖)
。单击(选择器(“按钮”)。使用文本(“启动”);
});
请注意,
getReact()
返回一个包含组件的道具、状态和键的对象。 组件的
app.name
属性不能包含