testing - “TestController”类型上不存在属性“openWindow”
问题描述
在我的测试中,我单击一个元素,然后打开新窗口。但我需要的是检查前一个窗口的请求。
我试图这样做:
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 版本。
推荐阅读
- angular - Angular 4 - 向阻止滚动的“鼠标滚轮”事件添加了非被动事件侦听器。
- python - 将具有离散特征索引的数组传递给python中的mutual_info_classif
- javascript - 谷歌反应地图 - 如何更改控制颜色?
- batch-file - 如何删除不包括父文件夹和第一个子文件夹的文件夹?
- sql-server - 在 MS SQL 2016 上对 NewID() 奇怪的结果进行排序
- jquery - jQuery自动检测输入状态
- javascript - 如何删除数据表中的特定行?
- java - Perl 兼容的正则表达式引擎:如何实现?
- angular - Angular 2+ 错误类型错误:无法读取未定义的属性“”
- arrays - 将标记化的单词组合成 pandas 中的单个列表