Domanda

I am new to BDD and Gherkin. Trying to use Cucumber, which parses Gherkin to Ruby - a language I don't know. Is there any library which converts Gherkin to Javascript ? If I get the Javascript output for Gherkin, I plan to modify the code and call some Javascript functions of my own. Please note, I am not planning to test these javascript functions - these functions are from some other testing tool I am trying to chain to. I Hope I am not planning to do something weird. All the problem is that our team does not want to learn Ruby. Please suggest some options.

I guess, what I need is a tool which allows me to write step definitions in javascript - as opposed to Ruby.

Thanks !

È stato utile?

Soluzione

I think you're looking for Cucumber.js: http://git.io/cukejs

Altri suggerimenti

Cucumber.js is a good option and Kyuri is a good alternative if you the stuff from nodejitsu :) https://github.com/nodejitsu/kyuri

Gherkin is a human-readable DSL, and cucumber doesn't care what language you use to create the step definitions.

While I don't see any javascript-specific examples on the cucumber wiki, you might want to check out cucumber.js.

You can try a cucumber.js authoring tool, called CukeTest, it has the following relevant feature.

  • Generate JavaScript code from steps text
  • Prompt you whether there are existing/pending/duplicate definition for a step.
  • Given a particular step definition code in JavaScript file, jump to the step definition that matches it
  • Switch from visual editing view to text view

There are both desktop version available, or Windows Store version. Here is a demo:

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top