目前,我正在将WebDriverIo版本从4升级到5,其中一个现有的测试是同时在两个选择器上应用waitForExist。在v4中,它类似于这个.waitForExist(selector + loadingSelector, null, true)
,但是在V5 waitForExist中,链接到选择器,因此我将其重构为await (sel1+loadingSelector).waitForExist(0,true,null);
,但是这个抛出错误‘`TypeError:(selector + loadingSelector).waitForExist不是一个函数
下面是我的命令代码:
addIdeCommand('ideOpenFolder', async function (folder, treeCls, fuzzy) {
var sel1 =await browser.$(sel1);
var loadSelector = await browser.$(sel2);
await sel1.waitForDisplayed();
// Wait for the loading icon to disappear (true = not exists)
**await (selector+loadSelector).waitForExist(0,true,null);**
await this.waitUntil(async function () {
//something
});
});
有人能帮我同时在多个选择器上应用waitForExisting()吗?
发布于 2022-06-12 00:17:27
您可以使用Promise.all:
await Promise.all([
method1,
method2,
...
])
https://stackoverflow.com/questions/72576599
复制相似问题