小编Tal*_*lKU的帖子

将ReactSelector用于TestCafe时,不断获取`ReExecutablePromise {_then:[],_fn:[Function],_taskPromise:null}

我正在尝试使用TestCafe在React网站上实施测试。我想使用getReact()打印各种道具/属性。但是,当打印到控制台时,我总是得到ReExecutablePromise { _then: [], _fn: [Function], _taskPromise: null }

这是我的代码:

var sideBar = ReactSelector('Sidebar').getReact();
console.log(sideBar);
Run Code Online (Sandbox Code Playgroud)

我还尝试获取实际属性:

sideBarprops = checkListPage.sideBar.getReact(({ props }) => props.isChecklistVisible);
console.log(sideBar);
Run Code Online (Sandbox Code Playgroud)

任一项总是打印 ReExecutablePromise { _then: [], _fn: [Function], _taskPromise: null }

我需要能够打印ReactSelector的属性,类名,状态,键等的实际值。

automated-tests web-testing reactjs e2e-testing testcafe

2
推荐指数
1
解决办法
237
查看次数