【发布时间】:2018-03-07 13:29:23
【问题描述】:
当页面存在(或打开)时,我需要在页面上做一些动作。但是其他异步代码可以随时关闭它。 我尝试使用代码,如下所示:
async.whilst(
function(){ /*TEST function: return true if page is opened or false otherwise*/},
function (cb){
(async()=>{
await page.evaluate(_=>{/*some code*/})
})();
},
callbackopt
)
我如何知道页面是打开还是关闭,将此代码传递给测试函数?
【问题讨论】: