Is there a way I can get autocomplete on VS Code for webdriverio?
Other code editors like Intellij provide something like Settings -> Preferences -> Languages & Fram
my understanding is, vscode is built with typescript
and by default it does not support autoComplete(Intellisense) on a package that is built with javascript
. So all the js package creators would provide an @types
file. These @types
file help vscode to find all the function definitions, object properties. etc., etc., of your JS package and show as suggestions. Which in case here is webdriverio
package.
So adding a @types
dependency that is related to your JS package will mostly fix the issue.
i.e.,
npm install @types/webdriverio --save-dev
After adding the package, i started getting the browser object suggestions.
All the above works fine for v4 version of WDIO.
If you are using v5 version: Then as per their official documentation we need to create a jsconfig.json
file on the root directory.