Visual Studio 2013 protractor intellisense

自作多情 提交于 2019-12-22 01:15:48

问题


First of all, I am very beginner in using node.js / angualar.js /protractor.js and jasmine.js stuff and I am not from web dev corner at all. But for now, I just want to create some protractor test for an angular app and this is actually working quite fine. But I am wondering if it's possible to get VS2013 intellisense working? I would really appreciate if VS would suggest functions of objects like 'browser.xxx'. I am really stuck with that, looking forward for some hints!

thx Florian


回答1:


Ill just give an answer to myself! To get Visual Studio 2013 intellisense and debugging working for angular protractor tests, follow these steps:

  1. Install node.js
  2. Install protractor (global) („npm install -g protractor“; „webdriver-manager update“)
  3. Install Visual Studio 2013 node.js Tools
  4. Install Visual Studio 2013 TypeScript Tools

  1. Create a new project „Typescript\Node.js\Blank Node.js Console Application“
  2. Add your „conf.ts“ and „spec.ts“ files to the project
  3. Right click on „conf.ts“ and select „Set as node.js startup file“
  4. In „Project properties“ set your „Node.exe path“ to your protractor executeable file, eg. „C:\Users\myUser\AppData\Roaming\npm\protractor.cmd“

  1. Download typescript DefinitelyTyped definitions from git hub:
    • https://github.com/borisyankov/DefinitelyTyped
  2. In your VS2013 project folder „Scripts\Typing“ create the subfolders „jasmine“, „protractor“ and „selenium-webdriver“
  3. Add the typing definition files "angular-protractor\angular-protractor.d.ts", "jasmine\jasmine.d.ts" and "selenium-webdriver\selenium-webdriver.d.ts" into the appropriate project folders you created in the step above.

  1. Write your protractor test and enjoy code highlighting
  2. Start webdriver-manger „webdriver-manager start“
  3. Hit „F5“ to start debugging

Enjoy! Florian



来源:https://stackoverflow.com/questions/28748967/visual-studio-2013-protractor-intellisense

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!