属性"openWindow"在类型"测试控制器"上不存在



在测试中,我单击一个元素,然后打开新窗口。但我需要的是检查来自上一个窗口的请求。

我试着这样做:

https://devexpress.github.io/testcafe/documentation/reference/test-api/testcontroller/openwindow.html

import { Selector } from 'testcafe';
fixture `Example page`
.page `http://www.example.com/`;
test('Open the TestCafe website', async t => {
await t
.openWindow('http://devexpress.github.io/testcafe')
.openWindow('./documentation');
const localWebsite = await t.openWindow('file://path/to/my/website');
});

但我得到了这个错误:

Property 'openWindow' does not exist on type 'TestController'.

您的测试用例在最新版本的TestCafe 1.9.0中运行良好,这个API就是在这个版本中引入的。

确保您使用的是正确的TestCafe版本。

最新更新