0

I`m using phpstorm with protactor for angular and for some reason the IDE doesnt recognize some

functions. but the functions is working fine when i`m running the test.

for example:

  element(by.buttonText('toggle')).click();

        expect(element(by.css('.net-fade')).getText()).
          toEqual('something');
      })

The IDE tell me that the method by.css is "unresolved function or method".

Someone know how to fix it?

Bazinga
  • 10,716
  • 6
  • 38
  • 63
  • this may help, although your issue might be more complicated: https://www.jetbrains.com/webstorm/help/configuring-javascript-libraries.html – goat Dec 26 '14 at 23:30

1 Answers1

0

I'm not familiar with PHPStorm, so this won't be a full-answer:

But I'd say the basic problem is that Protractor binary auto-inserts protractor.js and other dependencies into the environment for you. This is what gives you by (along with other helper variables browser, element, etc).

You may want to insert protractor.js yourself, you can find it in

node_modules/protractor/lib/protractor.js

(And again, I am unsure of how PHPStorm includes files, but you might want to only manually add protractor.js if it is not running in test mode. And to this end, you could set flag in protractors onPrepare() function to check against).

Ashley Coolman
  • 11,095
  • 5
  • 59
  • 81