Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Protractor Tests in Visual Studio 2013

I have been able to write tests using protractor in VS2013, however, when I open my "Test Explorer" tab and right click on the test I want to run it fails within seconds. I'm wondering if it is not possible to run protractor tests this way and if they can only be run from the cmd.

I have checked out the links left on other questions on this site and none of them have fixed the issue I am running into.

like image 880
Dee Avatar asked Jan 07 '15 16:01

Dee


People also ask

How do I run multiple tests in protractor?

When you want to run protractor scripts by opening a browser instance for each test, you should add two capabilities shardTestFiles and maxInstances in the Capabilities block of the conf. js file. This will help to execute your scripts on same browser with multiple instances.


1 Answers

Yes that is possible to Run the Protractor Tests in Visual Studio.

To run the Tests, you need to create a Node.Js Console application (Get template online) and create the project.

Here are the Steps:

  • Install Node.js
  • Install Node.js Tools for Visual Studio
  • Configure JDK
  • Create a Node.js Console Application and install Protractor

    npm install protractor --save-dev

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

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

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

To get the tests in the Test Explorer in Visual Studio 2013, you need to get the Chutzpah Test Adapter which is a extension of visual studio.

you can either go to https://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe and download or go to Tools => extension and updates => search for this tool.

Once you have installed, you can run the tests directly from visual studio.

like image 107
Moiz Avatar answered Sep 28 '22 13:09

Moiz