属性 'openWindow' 在类型 'TestController' 上不存在

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

在我的测试中,我单击一个元素,然后打开新的 window。但我需要的是检查之前 window.

的请求

我正在尝试这样做:

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'.

您的测试用例在引入此 API 的最新版 TestCafe 1.9.0 中运行良好。

确保您使用的是正确的TestCafe version