我正在将一个量角器页面对象库从JavaScript转换为Typescript。我有一个静态实用方法,它会一直刷新,直到元素出现(或达到超时限制)。由于某些原因,我不能使用boolean值的promise作为thenable构造,我也不知道为什么。错误消息为error TS2345: Argument of type '(value: boolean) => Promise<{}> | undefined' is not assignable toTy
我有一个元素,它不允许使用CSS属性pointer-events: none;单击该元素,如何检查该元素是否可单击,就像在元素上执行.click()引发的异常(无法捕获UnknownError: unknownerror: Element is not clickable at point )一样,该元素是一个链接,因此我只想检查重定向是否发生,但由于此错误,它立即结束测试并尝试捕捉异常。
我创建了一个函数来返回一个布尔值,以了解某个元素是否存在,但我得到了 this is the status: false 我如何才能得到唯一正确或错误的响应,请帮助,我使用了一个if条件,但它显示了该响应async IsPresent(element){ await element.isPresent().then(function(status){} return console.log(err);