0

我正在尝试执行在这里找到的测试脚本https://www.npmjs.com/package/@applitools/eyes-testcafe 但是我收到一个关于 typescript transpile 的错误。如果保存为 .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 的新手,所以请不要假设。谁能建议如何使用 typescript 使 Applitools 在 testcafe 中工作

4

2 回答 2

2

看起来@applitools/eyes-testcafe模块附带的 TypeScript 定义不正确。

test/specs/applitoolsExample.ts将文件扩展名更改为.js或在存储库中写入有关此问题的问题applitools/eyes-testcafe

此外,您可以在此处找到很多示例。

于 2020-11-25T07:25:02.577 回答
0

这个问题现在在 @applitools/eyes-testcafe 版本 1.14.3 上得到解决

于 2021-07-15T06:36:35.107 回答