How to make JetBrains webstorm know about `element`, `by` in protractor test spec?

前端 未结 4 1634
既然无缘
既然无缘 2021-01-04 18:09

Right now in my Protractor test spec, Webstorm is complaining that all my element and by are \"Unresolvable type or element\"

4条回答
  •  無奈伤痛
    2021-01-04 18:39

    angular-protractor no longer appears on the list of TypeScript community stubs, presumably because protractor is now officially supported within the WebStorm IDE.

    So, in order to ger protractor code completion:

    1. Install protractor globally: npm install -g protractor
    2. On WebStorm, go to Project Settings > Javascript > Node.js and NPM, and make sure protractor appears in the package list.
    3. On Project Settings > Javascript > Libraries, click the Add... button and point WebStorm to the protractor directory in your global node_modules. In my Mac's case it's /usr/local/lib/node_modules/protractor.

提交回复
热议问题