AngularJS, Protractor, Visual Studio! SUPER DRY!!

I AM A .NET Developer. Visual Studio is the trench that I dig every day. AngularJS is the primary weapon that I use in the frontend. I want to have Protractor as my first aid kit which doesn’t play nicely without Node.js. But it’s all right, I can tame it!

Update: you might be interested in this sample project to dig in quickly. It contains a tiny AngularJS app and a few test cases.

Let’s shave the yak

Do you know that Node.js Project is actually a Node.js flavoured ASP.NET project?

  • Update selenium standalone server
    .bin\webdriver-manager update

  • Start selenium standalone server
    .bin\webdriver-manager start

  • Run test specs
    .bin\protractor protractor.conf.js

Debugging

  • Include node_modules\protractor\lib\cli.js into project and Set it as Node.js Startup File
  • In project properties, configure Script arguments as protractor.conf.js

Tools

  • taskkill /f /t /im chromedriver.exe
    Sometimes you are stuck while debugging because previous chromedriver session was not terminated properly. Use this to kill all chromdrivers that lurks around.

  • Testing out Protractor interactively
    The tool provides a REPL-ish way to test selector.
    It helps to test while writing the test. Instead of test after you finish the test spec.

Other things help you get started