Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 595
kanitw Avatar asked Feb 19 '14 17:02

kanitw


People also ask

Does WebStorm support HTML and CSS?

WebStorm helps you to easily create Web sites by letting you edit HTML, CSS and JavaScript, navigate through files easily and use auto completion for everything in your code.

How do I configure WebStorm?

To configure project settings, select WebStorm | Preferences on macOS or File | Settings on Windows and Linux from the main menu. Alternatively, you can press Ctrl+Alt+S to show the IDE settings. icon. Other settings are global and apply to all existing projects.


1 Answers

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.
like image 78
Vaiden Avatar answered Oct 24 '22 12:10

Vaiden