我正在尝试执行在这里找到的测试脚本https://www.npmjs.com/package/@applitools/eyes-testcafe
但是我在 typescript 转换中收到错误。
如果另存为.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不熟悉,所以请不要承担任何责任。谁能建议如何使Typeli在Testcafe中使用Applitools?

最佳答案

看来@applitools/eyes-testcafe模块附带的TypeScript定义不正确。
test/specs/applitoolsExample.ts文件扩展名更改为.js或在applitools/eyes-testcafe存储库中写入有关此问题的问题。
此外,您可以找到很多示例here

关于javascript - Testcafe Applitools typescript -错误: Property 'accessibilityValidation' is missing in type,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/64969368/

10-12 16:23