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

Custom formatter cucumberjs

I've been searching for a way to get cucumberjs report to output junit xml. I know that there's a bunch of npm modules that does this. However, they are NOT doing it how I want them to. They are splitting up each step as test case, but I would like…
2
votes
1 answer

Cucumber javascript - How can I automatically generate the step definitions files?

I'm interested in the question - is there any mechanism to automatically generate the step definitions files based on the feature files? I found a solution for the .Net - this is plugin for Visual Studio - specflow (see section "Generating Step…
Ruslan Borovok
  • 520
  • 2
  • 17
2
votes
0 answers

Supertest in Cucumber delay

I'm using supertest in cucumber step files to make a request to my API running in docker. Also, I'm using a Scenario Outline with Examples so the request is made 4 times. EDIT: I found that on the first request in cucumber I get this error in my…
jabbermonkey
  • 1,680
  • 4
  • 19
  • 37
2
votes
1 answer

CucumberJS: Take screenshot after each step

Has anybody figured out how to take screenshot for every step of a scenario in cucumberjs, and attach it to the json report?
AlexandrosD
  • 505
  • 4
  • 13
2
votes
2 answers

Selecting by text with Protractor

I am mostly familiar with java selenium, and I am new to both JS and Protractor. Lets say I am trying to click an option from a list of options with a common identifier.. var options = $('.options'); How could I get all elements with that common…
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
2
votes
2 answers

Running Protractor cucumber in parallel with consolidated report

This may sound duplicate but it is not. I know that I can use the below configuration in config file and start multiple instance of the chrome driver that would run the features in parallel that share the step definitions. capabilities: { …
Galileo123
  • 185
  • 4
  • 17
2
votes
1 answer

How can I use WebStorm to create a Cucumber step definition file in TypeScript instead of JavaScript?

I'm building a new e2e test suite using Cucumber.js and I'd like to use TypeScript for my step files. When I create a new step and I press Alt+Enter to have WebStorm generate a new step file the only option I am presented with is to create a…
Yehuda Miller
  • 309
  • 3
  • 11
2
votes
1 answer

fail-fast in cucumberjs, protractor

I added fail-fast to my cucumberOpts like below: cucumberOpts: { require: [ conf.paths.e2e + '/utilities/hooks.js', ], format: 'pretty', 'fail-fast': true }, I have all my tests in a path like this: C:/tests/*.feature I run my tests…
pelican
  • 5,846
  • 9
  • 43
  • 67
2
votes
2 answers

Taking A Screenshot & Restarting A Browser After A Scenario Failure With CucumberJs

I'm trying to do a relatively simple scenario with cucumberjs. Namely after a scenario failure I would like to restart the browser so that it is back to an initial state for the next scenario. Here is my attempt this.After({timeout: 30 * 1000},…
2
votes
2 answers

AssertionError: expected [ true ] to be true

I have faced with the strange assertions problem so even successful assertions are marked as failed, like this: this.expect(this.getWidget('contacts').isNamesDisplayed()).to.eventually.be.true.and.notify(next); and in the console I have: 1…
Byte Surfer
  • 33
  • 2
  • 5
2
votes
1 answer

Protractor - Error Handling in Framework

How can we handle error in a Protractor - Cucumber based framework? There are assert failures, which is a genuine fail and there are errors in javascript code (e.g. - element not found, array is empty, something undefined etc..). I wish to handle…
Manya
  • 315
  • 4
  • 17
2
votes
1 answer

Message: function timed out after 5000 milliseconds - Protractor & CucumberJS

cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm I keep getting this error after upgrading to cucumberJs version above. Failures: 1) Scenario: Get records from DB e2e\features\transac.feature:7 Step: Given…
pelican
  • 5,846
  • 9
  • 43
  • 67
2
votes
0 answers

cucumber event handlers attached via registerHandler are now passed the associated object instead of an

I upgraded my cucumber to the following: cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm And I noticed this message popping up: cucumber event handlers attached via registerHandler are now passed the…
pelican
  • 5,846
  • 9
  • 43
  • 67
2
votes
0 answers

How to send enter to input in protractor?

I am struggling with keyup.enter event on input search in my protractor/cucumber test (angular 2) I was trying: input_search.sendKeys(protractor.Key.ENTER) // also with Key.RETURN .then(() => { ... }); and…
Dariusz Filipiak
  • 2,858
  • 5
  • 28
  • 39
2
votes
1 answer

CucumberJS timeout error. Can I set "setDefaultTimeout" in my step?

I am testing a set of rules defined in database using CucumberJS and Protrator. I am doing a database call to fetch the set of rules (~ 1000). When I run the scenario 1000 times, it takes whole lot of time and timesout almost after 2/3 loops. Is…
Kapil Chokhawala
  • 196
  • 2
  • 10