6

Is there a project with similar goals as Specflow is to cucumber in Visual Studio, but for cucumberjs?

I'm considering a unit testing / bdd framework for Visual Studio. Cucumberjs seems like the obvious choice as I am using Specflow to test the c#. However cucumberjs requires nodejs to be installed.

Chutzpah runs things like jasmine, qunit etc in Visual Studio. Is there a way to do the same for cucumberjs? Perhaps nodejstools for visualstudio with a mixture of something else?

There is a Feature request: Cucumber-js support for Chutzpah, but it's work in progress.

(Chutzpah was moved to github, so the issue was lost)

A new Chutzpah feature request on github for cucumber-js support

There is an interview with a cucumber core member saying (below) which sounds promising:

"Support for Cucumber.js is being added to popular IDEs like Jetbrains Webstorm 8 and Visual Studio."

Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152
  • So, any update? How to do BDD in VS? – Toolkit Mar 28 '15 at 14:26
  • Hi @Toolkit it's not something I've looked at since in particular. Last time I did BDD in visual studio I used jasmine with chutzpah. However many things have changed with Visual Studio and JavaScript support namely nodejs tools and the task runner explorer (for gulp and grunt) so that may offer more insight. – Alex KeySmith Mar 29 '15 at 12:01
  • so it seems like things are changing fast indeed. So I have an Angular SPA and it talks to Web API. What would be a appropriate set of testing tools? Thanks a lot! – Toolkit Mar 29 '15 at 12:20
  • @Toolkit I'd probably recommend opening another question particular to Angular and WebAPI as that's treading into a different area. However chutzpah offers good integration specifically to unit tests. For a general automation approach I'd recommend looking at the Task Runner Explorer extension if you plan to use gulp or grunt. – Alex KeySmith Mar 29 '15 at 12:30
  • 1
    honestly i am going nuts after two days of trying. I haven't managed to run ANYTHING, no cucumberjs, no jasmine, no bower or gulp. what on earth is going on?? it was long time since I met so much crap online.... Looks like a bunch of retards are writing some sporadic ideas, not tutorials – Toolkit Mar 30 '15 at 13:50
  • @Toolkit sorry to hear you're having trouble, because the question I opened is quite specific, if you are running into problems with tooling I'd recommend opening another question so that it gets attention, as this question was opened a long time ago. – Alex KeySmith Mar 30 '15 at 15:53

2 Answers2

4

As per David Leitner's reply, I've created a step-by-step guide to setting up cucumberjs in Visual Studio.

http://blogs.endjin.com/2015/10/step-by-step-guide-to-setting-up-cucumberjs-in-visual-studio-2015/

Matthew Adams
  • 464
  • 3
  • 6
  • Thanks for sharing! SpecFlow highlights each step in feature files that are not mapped to a step definition. It's pretty handy when you get these feature files from the test team and you're tasked to match them up to definitions. I have a feeling that this (or any) solution does not provide us with such a mapping within the editor. Am I right on that? I know that when you run it you see which ones are not mapped, but that's not what I mean. – The Victor Feb 18 '16 at 15:19
  • Sorry for the long delay - yes; that's correct. However, I'm slowly working on VS integration for a Cucumber. I've got a basic test runner working, and I'll publish the code and VSIX as soon as I get a spare minute; hopefully that will get us going and someone else can help build it out! – Matthew Adams Apr 13 '16 at 23:35
1

I've done this by using the Visual Studio Task Runner Explorer. (You have to add it if you use VS 2013, with 2015 it's already included.)

This Extension is a task runner for Grunt and Gulp directly within Visual Studio 2013. It is now possible to define a Grunt task, like this one which runs your cucumberjs Features.

David Leitner
  • 3,312
  • 1
  • 18
  • 27
  • Thanks David. Good response for anyone who comes across this question, I must admit I forgot about :-) Visual Studio is a changed world, I too am using the Task Runner Explorer for gulp tasks, that's true it would be a great option these days for cucumberjs. – Alex KeySmith Aug 04 '15 at 14:00