Testcafe Applitools typescript - Error: Property 'accessibilityValidation' is missing in type

197 Views Asked by At

I'm trying to execute the test script found here https://www.npmjs.com/package/@applitools/eyes-testcafe But am receiving an error on typescript transpile. The script runs succesfully if saved as a .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.

I am new to js, ts and testcafe so please assume nothing. Can anyone advise how to make Applitools work in testcafe, with typescript?

2

There are 2 best solutions below

1
On

It looks like the TypeScript definitions shipped with @applitools/eyes-testcafe module are incorrect.

Change the test/specs/applitoolsExample.ts file extension to .js or write an issue about this problem in the applitools/eyes-testcafe repository.

Also, you can find a lot of examples here.

0
On

The issue is now solved on @applitools/eyes-testcafe version 1.14.3