我想只使用部分 url 主机名切换到新窗口。 例如代替
我想用这样的东西:
以上这两个都不起作用。还有其他可能吗?
您可以使用RegExp api。例如:
fixture('My fixture')
.page('https://testcafe.io/');
test('First test', async t => {
await t
.openWindow('https://devexpress.github.io/testcafe/example/')
.switchToParentWindow()
.switchToWindow((w) => /example/.test(w.url.href))
});