Questions tagged [cucumberjs]

The Cucumber project is a Behavior Driven Development (BDD) tool originally designed to work with Ruby. However, since its inception its popularity has grown and there have been implementations of Cucumber written for different languages including Java, .Net, Flex, and JavaScript.

Cucumber understands a language named Gherkin which allows features and specs to be written in a plain text format. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented.

Gherkin serves two purposes — documentation and automated tests. The third is a bonus feature — when it yells in red it’s talking to you, telling you what code you should write.

Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.

848 questions
2
votes
1 answer

Failing simple cucumber.js + zombie tests

I'm setting up cucumber.js tests for my project. I followed the tutorial available here: http://cloudspace.com/blog/2014/11/25/cucumber/#.VYe4w87sNRE I also tried other tutorials, but they all are pretty the same and resulted in the same problem. I…
Jakub
  • 3,129
  • 8
  • 44
  • 63
2
votes
1 answer

Cucumber.js TypeError: Cannot read property 'pending' of undefined

I am using Node.js, cucumber.js(globally installed) and Web Storm IDE with a simple add number scenario and I get the below error. The step definition does not have anything else other than callback.pending. any thoughts please? TypeError: Cannot…
Vamsi
  • 95
  • 2
  • 10
2
votes
1 answer

Protractor tests with CucumberJS passing irregularly

Trying out some BDD with AngularJS so I'm having a go at automating scenarios with Protractor and CucumberJS. Strangely, It been the devils job trying to get step defintions to fail intelligently. Features.feature Feature: Calculator As a user …
item
  • 85
  • 6
2
votes
0 answers

Run CucumberJS tests in Webstorm with Harmony flag?

I am just spiking to see if we can get some of the ES6 goodness into our existing codebase, and so far so good although when I went to start up our cucumber js tests from webstorm it blows up with the ES6 syntax. So has anyone else got this working?…
Grofit
  • 17,693
  • 24
  • 96
  • 176
2
votes
1 answer

Cucumber-js: World constructor example with phantomjs

In the cucumber-js page is showed an example with Zombie: // features/support/world.js var zombie = require('zombie'); var WorldConstructor = function WorldConstructor(callback) { var browser = new zombie(); var world = { browser: browser,…
rjurado01
  • 5,337
  • 3
  • 36
  • 45
2
votes
2 answers

WebStorm can't connect cucumber.js gerkhin to actual step definitions

I have a test suite that works fine when ran from the command line. In WebStorm, however, all my steps in the .feature file, WebStorm says they cannot find the step definitions. I have moved them to a step_definitions folder as well, in which when I…
cgsd
  • 1,242
  • 2
  • 13
  • 25
2
votes
1 answer

code coverage for cucumber.js?

I am just struggeling if there is solution to do a code coverage analysis of the tested code which was executed in javascript cucumber? Also the code coverage should be provided in the cobertura file format to embed it in our existing analysis of…
cilap
  • 2,215
  • 1
  • 25
  • 51
2
votes
2 answers

cucumber js unable to create profiles

Have been searching for a bit and haven't found anything that answered my question. I have a simple Cucumber.js project, was trying to implement profiles just like you can do in ruby under the cucumber.yml file, but can't really find out how to do…
VankOde
  • 23
  • 1
  • 5
2
votes
1 answer

BeforeFeature hook get Feature name

I am implementing BeforeFeature hook and I want to know which feature I am in var hooks = function () { this.registerHandler('BeforeFeature', function (event, callback) { console.log(event.feature ????) }); }; When I debug,…
Jenninha
  • 1,357
  • 2
  • 20
  • 42
2
votes
2 answers

Protractor, Cucumber and chai as promised: When chai assertion fails

I am using protractor to run my cucumber tests. Inside my test I have the following assertion: label.getText().then( function(labelText){ labelText = labelText.trim(); console.log('label text:…
Jenninha
  • 1,357
  • 2
  • 20
  • 42
2
votes
1 answer

How do I only see the header of an error in Cucumber JS?

I'm trying out some BDD with nodeJS using a grunt-triggered Cucumber JS task, which is working fine except that I don't want to see the full JS exception stack for a test that I know will of course fail. Instead, I'd rather just see the (more…
GMeister
  • 331
  • 2
  • 15
2
votes
0 answers

Basic CucumberJS and Zombie Use Case

Good Day my fellow Comrades in Code: I followed some vanilla set up examples for using zombie and cucumber. The basic problem is that I visit a site in the first step. Then, in the next step, the zombie browser is not aware of it any more. I have a…
RedMage
  • 1,126
  • 1
  • 9
  • 21
2
votes
1 answer

when / how often to use Chai-as-promised's .notify()

We are using Chai-as-promised with protractor and cucumberjs. I have a question about the .notify(callback) method in the chai-as-promised library. If we are running multiple scenarios with a few steps in each. Should notify() be called at the end…
Brad8118
  • 4,672
  • 11
  • 36
  • 48
2
votes
0 answers

test meteor server side code with meteor-cucumber

I have successfully written features and the implementation of the steps for client side testing with meteor-cucumber but I can not figure out how to implement server code. In the application there is a batch process which is started in…
Micha Roon
  • 3,957
  • 2
  • 30
  • 48
2
votes
2 answers

Can I test KnockOut ViewModel on Cucumberjs

I've defined the following feature Feature: Shoper can add an item to ShoppingCart Scenario: First item added to ShoppingCart Given I have an Empty ShoppingCart When I add an Item to ShoppingCart Then The ShoppingCart must have 1…
Caputo
  • 185
  • 1
  • 15