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
2 answers

How do I stop cucumberjs after scenarios complete?

After successfully finishing the scenarios, cucumberjs hangs - indefinitely. How can I get this to stop? I've got a cucumberjs running on npm/nodejs. package.json: { "name": "foo-test-automation", "version": "1.1.0", "description":…
Huckleberry Carignan
  • 2,002
  • 4
  • 17
  • 33
2
votes
4 answers

How the order of 'After' hooks can be configured in Cucumber js?

There are several 'After' hooks and one of them should be first than others, how it could be configured in the Cucumber JS?
2
votes
3 answers

Implement requestHooks in cucumber/testCafe

When I want to add requestHooks (for example) to my test and fixture I basically don't know where to do it. I am using this repo https://github.com/rquellh/testcafe-cucumber
2
votes
1 answer

Not able click on a element after hovering in chrome

I am trying to click on a element which is visible only after hovering. browser.actions().mouseMove(element(by.css(".frx-mywork-main-block .frx-mywork-main-body-block3"))).perform(); browser.sleep(5000); element(by.css(".frx-mywork-main-block…
Devleena
  • 453
  • 9
  • 25
2
votes
0 answers

Cucumber Reports not generated on jenkins job

So I upgraded my protractor to version 5.3.0 and since than cucumber reports are not generated. I suspect it is version mismatch issue but i'm not sure. I've tried some of versions of cucumber but it doesn't help. Can anyone shed some light on…
2
votes
2 answers

How do I set a boolean in parameter types for Cucumber?

Cucumber allows you to pass int, string, floats as parameter types, is there a way to do it with Booleans? Given('the property {string} is set to {string}', function (path, value) { this.requestBody = this.requestBody || {}; …
ihossain
  • 343
  • 1
  • 8
  • 19
2
votes
1 answer

How to open two browser window in same cucumber scenario using testcafe?

Testcase: Verify video resume point Open chrome browser Launch web application Login with an user Play a video Note video played time Close browser Open chrome browser again Launch web application and login with same user Play the same video Video…
2
votes
1 answer

Sharing the same Selenium WebDriver in several step definition files

My question is basically the same as this one. But I am writing my tests in JavaScript. I want to have several step definition files. I tried creating a file with exported driver like this var webdriver = require('selenium-webdriver'); var driver =…
sininen
  • 503
  • 1
  • 6
  • 20
2
votes
1 answer

CucumberJs : is it possible to define more than one "World"

Following this example, I have written 2 different tests. Is it possible to define more than one "World" ? i.e. define different World for different tests suite ? For me for the moment, it seems not to be possible, because all files are read and…
xnopre
  • 583
  • 1
  • 4
  • 10
2
votes
0 answers

Matching variables with spaces using cucumber anonymous expresion

With a feature containing a Scenario Outline and an Example table like: Feature: Demonstrate Issue Scenario Outline: Parameters with spaces don't match Given a variable containing Examples: | var | | No_Spaces…
Des Horsley
  • 1,858
  • 20
  • 43
2
votes
1 answer

How to set custom meta data for feature at multiple-cucumber-html-reporter?

I have a problem with creating custom meta data in multiple-cucumber-html-reporter. Here is a example of custom meta data. How to set custom meta data for cucumber features? Thank you in advanced.
Enes Pekkaya
  • 304
  • 2
  • 3
  • 14
2
votes
2 answers

How to test in cucumber-js a that a result is a multi line string?

I would like to test whenver the result of a step has a certain value, but this value is a multiline string that contains |, - and any special characters. The string can look like: { ------- }| {aaaaaaaaaa| {aaaaaaaaaa| I'm not sure how can I do it…
Totty.js
  • 15,563
  • 31
  • 103
  • 175
2
votes
1 answer

ConnectionError: Connection lost - read ECONNRESET in protractor

I am using protractor 52.2 and cucumber 3.2.2. I am using selenium grid(selenium-server-standalone-3.14.0.jar) with the protractor and running my script in 4 browsers of 4 different nodes. I have a table of 600 rows in the DB. Initially, I am…
2
votes
2 answers

AfterAll hook error - 'this' is not referring to my world constructor when using cucumber-js and selenium

I am getting 'AfterAll hook errored' when attempting to close my browser at the end of my tests (using cucumber-js and selenium). 'this' is not referring to world as it does in my step.js files This is my hooks.js file: const { AfterAll, Before } =…
R. Cooper
  • 21
  • 1
  • 5
2
votes
3 answers

Javascript console.log status of Cucumber scenario

I would like to print the status of each cucumber scenario using the afterScenario hook. I've tried printing out scenario.status (code below) but it prints out "undefined" afterScenario: (scenario) => { console.log(scenario.status); } When…
Daredevi1
  • 103
  • 3
  • 13