我正在尝试执行此处的测试脚本https://www.npmjs.com/package/@应用工具/眼睛测试咖啡馆但是我收到了一个关于typescript transfile的错误。如果保存为.js.,脚本将成功运行
test/specs/applitoolsExample.ts:10:19 - error TS2345: Argument of type '{ appName: string; testName: string; browser: { width: number; height: number; name: "firefox"; }[]; t: TestController; }' is not assignable to parameter of type 'OpenOptions'.
Property 'accessibilityValidation' is missing in type '{ appName: string; testName: string; browser: { width: number; height: number; name: "firefox"; }[]; t: TestController; }' but required in type 'OpenOptions'.
10 await eyes.open({
~
11 appName: "Hello World!",
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
14 t,
~~~~~~
15 });
~~~
node_modules/@applitools/eyes-testcafe/ts/eyes.ts:8:9
8 accessibilityValidation: AccessibilitySettings
~~~~~~~~~~~~~~~~~~~~~~~
'accessibilityValidation' is declared here.
Found 1 error.
我是js、ts和testcafe的新手,所以请不要想当然。有人能建议如何让Applitools在testcafe中使用typescript吗?
@applitools/eyes-testcafe
模块附带的TypeScript定义似乎不正确。
将test/specs/applitoolsExample.ts
文件扩展名更改为.js
,或在applitools/eyes-testcafe
存储库中编写有关此问题的问题。
此外,你可以在这里找到很多例子。
该问题现已在@applitools/eyes testcafe版本1.14.3 上解决