webdriverio / codemod

A codemod to transform Protractor into WebdriverIO tests
MIT License
25 stars 12 forks source link

$ or $$ are not recognised in V7 working fine in V5 #42

Closed diwakar-jha3110 closed 2 years ago

diwakar-jha3110 commented 2 years ago

Cannot find name '$'. Do you need to install type definitions for jQuery

Also issue with the types as import element = WebdriverIO.Element; WebdriverIO is getting picked from @wdio/sync not from @wdio/mocha-framework

tsConfig.json is as below { "compilerOptions": { "baseUrl": ".", "lib": ["es2017", "dom"], "module": "commonjs", "target": "es6", "strict": false, "strictNullChecks": false, "resolveJsonModule": true, "typeRoots": [ "./declarations", "./node_modules/@types", "./node_modules/@wdio/@types", "./node_modules/webdriverio/async", "./node_modules/@wdio/mocha-framework"], "exclude": ["node_modules"] }

christian-bromann commented 2 years ago

@diwakar-jha3110 thanks for raising an issue. Please see https://webdriver.io/docs/typescript#framework-setup, you need to set the types property in your tsconfig file, e.g.:

{
    "compilerOptions": {
        "types": ["node", "webdriverio/sync", "@wdio/mocha-framework"]
    }
}