Inconsistent auto-complete behavior in webstorm

414 views
Skip to first unread message

Mek Stittri

unread,
Jun 16, 2015, 1:47:33 PM6/16/15
to nightw...@googlegroups.com
Dear WebStorm experts,

I am seeing inconsistent auto-complete for the NightWatchJS APIs eg. auto-complete works for browser.switchWindow() but not for browser.waitForElementVisible()


Also I am not sure if we are able to do an autocomplete on NW page objects from browser.page.<page object name>

eg. LoginPage is not coming up when browser.page.Log is typed




I was also looking at - https://groups.google.com/forum/#!searchin/nightwatchjs/completion/nightwatchjs/VLVY8BZSlBw/ic-H2kS2lpIJ
But then the thread got hijacked to creating a debug run.

I am still fairly new to both WebStorm and NW so I may have missed some configuration, would appreciate any help.
I am using the default configuration out of the box and I was also wondering if other WS users on here are using any additional lib configuration.

  • Installed everything via npm and all artifacts are in node_modules which is also marked as a JS library in webstorm (project level)
  • NodeJs Core modules are also downloaded as external lib and tick enabled.

Current dir structure looks like this

-- project root
     |
     |-- node_modules (Marked as library home by WS)
         |
         |-- chromedriver
         |-- nightwatch 
         |-- selenium-standalone 
     |
     |-- page_objects
     |-- reports
     |-- tests

See attached 


Thanks for all the help folks!


GrayedFox

unread,
Jul 2, 2015, 9:38:49 AM7/2/15
to nightw...@googlegroups.com
Hey there Mek,

Just wanted to confirm the same problem here. Have upgraded node to latest, reconfigured project, and added nightwatch library as framework type "node_modules" but I only get autocomplete for some things (i.e. waitForConditionTimeout is found, and when using CTRL+B to goto definition, it correctly goes to the nightwatch def. however waitForElementVisible cannot find a definition).

Trying to make progress, lets share our progress if we make any.

Mek

unread,
Jul 4, 2015, 5:50:51 PM7/4/15
to nightw...@googlegroups.com
Hi There,

I was able to get some of the commands to work.
I also marked the src vs test directory and also added some of the NW dirs as project lib.
Will post a screenshot when I get back home. 

But I think because of the dynamic nature of JS and nightwatch page object reference browser.pages.<your-page-object>, I dont think this is 100% reliable unless we do an explicit import of the page object file itself.
I maybe wrong but will gladly accept other people's feedback on getting this to work like IntelliJ and Java libs.

Have a great 4th july weekend!

GrayedFox

unread,
Jul 6, 2015, 5:23:08 AM7/6/15
to nightw...@googlegroups.com
Hey Mek,

I ended up adding the entire Nightwatch folder as library (just to see) - I got a lot of duplicate entries in the autocompletion suggestions for some functions but still completely lacked others. Not sure. I filed a bug report with JetBrains - they accepted it as a bug and have assigned someone - perhaps we will see a fix!
Reply all
Reply to author
Forward
0 new messages